python

PPTX 12 стр. 1,5 МБ Бесплатная загрузка

Предварительный просмотр (5 стр.)

Прокрутите вниз 👇
1 / 12
powerpoint presentation what is python? what is python? python is a popular high-level programming language used in various applications python is an easy language to learn because of its simple syntax python can be used for simple tasks such as plotting or for more complex tasks like machine learning variables, objects, and classes a variable is a reference to a value stored in a computer’s memory. variables can be sorted into a variety of categories (or data types) such as numbers (int/float etc), boolean values (true/false), and sequences (strings, lists etc). an object is a collection of data from a computer’s memory that can be manipulated. all variables are objects although some objects can be defined by data referred to by multiple variables. methods are the functions used to act on/alter an object’s data. they describe what your object can “do.” variables, objects, and classes (cont.) a class is a …
2 / 12
wn). mystring = “hello, world” myint = 7 myfloat = 7.0 mylist = [7, 8, 9] myboolean = true basic syntax rules function syntax def...: indicates that you are defining a new function. function() refers to the name of your function. by convention, this name is typically lowercase and represents a verb/action. a,b refers to parameters (values or variables) that can be used within the statements of your function’s definition (......). if your function has no parameters, an empty parenthetical () is used. the return statement is an optional statement that will return a value for your function to your original call. def function(a, b): ...... return a + b basic syntax rules (cont.) calling a function call the function by referring to its name (function()) and by placing any necessary arguments (1, 2) within the parenthesis separated by commas. myvalue = function(1, 2) if you wish, you can set …
3 / 12
2 print(y) if-else statements if-else statements allow programmers to adapt the function of their code based on a given condition. if a given condition (i.e. x % 2 == 0) is true, then the statements following the if statement (if) will be executed. if the condition is false, the statements following the else statement (else) will be executed. the condition is tested using the boolean operators == (is equal to), != (is not equal to), and (used to test multiple conditions), and or (used to test if at least one condition is true). additionally, else-if statements (elif) can be used to provide unique coding statements for multiple conditions. xstring = input(“enter a number: “) x = int(xstring) if x % 2 == 0: print(“this is an even number”) elif x == 0: print(“this number equals 0”) else: print(“this is an odd number”) for loops for loops perform the same task …
4 / 12
nt for/while loop iteration and return to the beginning of the loop. mystring = input(“enter a number: “) myint = int(mystring) x = 0 while x < 5: print(myint) x= x +1 image1.png image2.png image3.png image4.png image5.png image6.png image7.png image8.png image9.png image10.jpeg image11.png image12.png image13.png image14.png image15.png image16.png
5 / 12
python - Page 5

Хотите читать дальше?

Скачайте все 12 страниц бесплатно через Telegram.

Скачать полный файл

О "python"

powerpoint presentation what is python? what is python? python is a popular high-level programming language used in various applications python is an easy language to learn because of its simple syntax python can be used for simple tasks such as plotting or for more complex tasks like machine learning variables, objects, and classes a variable is a reference to a value stored in a computer’s memory. variables can be sorted into a variety of categories (or data types) such as numbers (int/float etc), boolean values (true/false), and sequences (strings, lists etc). an object is a collection of data from a computer’s memory that can be manipulated. all variables are objects although some objects can be defined by data referred to …

Этот файл содержит 12 стр. в формате PPTX (1,5 МБ). Чтобы скачать "python", нажмите кнопку Telegram слева.

Теги: python PPTX 12 стр. Бесплатная загрузка Telegram