-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython.py
More file actions
29 lines (22 loc) · 783 Bytes
/
python.py
File metadata and controls
29 lines (22 loc) · 783 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
#Sx de python
#py indentation:
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 5 > 2:
print("Five is greater than two!")
#variables:
x = str(3) # x will be '3'
y = int(3) # y will be 3
z = float(3) # z will be 3.0
print(type(z))
a = 4
A = "Sally" #A will not overwrite a
print(a)
print(A)
'''A variable name must start with a letter or the underscore character
A variable name cannot start with a number
A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
Variable names are case-sensitive (age, Age and AGE are three different variables)
A variable name cannot be any of the Python keywords.'''