Search for notes by fellow students, in your own course and all over the country.
Browse our notes for titles which look like what you need, you can preview any of the notes via a sample of the contents. After you're happy these are the notes you're after simply pop them into your shopping cart.
Title: python2 variables and data type
Description: This is the 2nd lesson of python Variables and Datatypes...
Description: This is the 2nd lesson of python Variables and Datatypes...
Document Preview
Extracts from the notes are below, to see the PDF you'll receive please use the links above
002: Variables and Datatypes
Learning Outcomes: Concept of variable, rules of naming a variable, data types: int, float, String;
Relational Operators
Definitions/Concepts
Variable ● It is a unique memory location in the computer which holds the value we assign to it
...
a=1000
here a is the variable which stores the value 1000 in it
...
eg
...
avg_score, t_5
● It can’t have spaces in between
● Keywords can’t be used as variable names
...
e
...
print can’t be used as variable
Datatype ● The type of value stored in a variable is called the datatype of the variable
...
e
...
a=1000 Here the data type of a is int
float- It stands for floating point or decimal numbers
...
g
...
6
Here, the data type of b is float
String - Anything written within quotes(single or double) is of String Data type
...
g
...
● We can simply create variables by assigning values to it
...
● > Greater than
● < Less than
● >= Greater than or equal to
● <= Smaller than or equal to
● == Equals to
● != Not equal to
Difference between = and ==
The single equal to operator (=) is the assignment operator, which is used to give values to a variable
...
Operation on Variables
● We can use the print() function to display the value of the variable on screen also
...
Title: python2 variables and data type
Description: This is the 2nd lesson of python Variables and Datatypes...
Description: This is the 2nd lesson of python Variables and Datatypes...