-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlesson2_syntax.py
More file actions
38 lines (27 loc) · 849 Bytes
/
lesson2_syntax.py
File metadata and controls
38 lines (27 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#Execute Python Syntax
########################
#We can execute python code by either typing directly into
#python CLI
#Example
# >>> print("Hello, World!")
# Hello, World!
#Or execute python code from a file
#Example
#C:\Users\Your Name>python myfile.py
#Python Indentation
######################
#Indentation refers to the spaces at the beginning of a code line.
#Python uses indentation to indicate a block of code.
if 5 > 2:
print("Five is greater than two!")
#The number of spaces is up to you as a programmer
#The most common use is four,
#But it has to be at least one.
if 6 > 3:
print("six is greater than three!")
if 6 > 3:
print("six is greater than three!")
#You must have the same number of spaces in the same block of code
#otherwise Python will give you an error:
if 6 > 3:
print("six is greater than three!")