-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBasics of Python.py
More file actions
22 lines (19 loc) · 985 Bytes
/
Copy pathBasics of Python.py
File metadata and controls
22 lines (19 loc) · 985 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#Basics of python
#printing stataements
print("Hello World!")
#Variabales
name = "MoonLawlier!" #string ( can be between '', "", "' '")
age = 17 #integer ( do not need double quotes!)
is_adult = False #Boolean datatype (True or False ) (do not use true and false)
print(name, "I'm 17 years old.")
print(age)
#or
print(" My name is: ", name)
# For a variable name we cannot use symbols like % & # $ bu twe can use _
#We cannot start a variable name with a number ; ex:- 1variable is not valid !
print(type(name)) #type is used to find the data type in python
print(type(age))
#Their are five data types: integers, strings, float, boolean, none
#reserved words in python: and, as, assert, break, class, continous, def, del, if, else, except, finally, False, True, for, from, global, in, is, lambda, nonlocal, None, not, or, pass, return, try, with, while, yield, raise, import, elif
#reserved words can't be used for variable name
#case sensetive: Apple and apple are different