- String variables are defined using two
"
s around the text
A variable is a representation which can contain data of ANY type in Python.
Example:
my_name = "Ehmad Zubair"
Two strings can be added using a +
sign.
Example:
my_full_name = "Ehmad Zubair " + "Chughtai"
Numbers are of two types:
- int
- float
Numbers are manipulated using very basic characters +
,-
,*
,/
Example:
addition_result = 5 + 9
subtraction_result = 12 - 3
- String
- Number
- Boolean
Help: If you don't know the type of a variable, use type(variable_name)
to see what type it is.
input()
is used to get user input from the keyboard
- is equal to
==
- is greater than
>
- is greater than or equal to
>=
- is less than
<
- is less than or equal to
<=
- and
- or