-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVariables_start.py
More file actions
37 lines (28 loc) · 887 Bytes
/
Variables_start.py
File metadata and controls
37 lines (28 loc) · 887 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
# LinkedIn Learning Python course by Joe Marini
# Example file for variables and basic types
# Basic data types in Python: Numbers, Strings, Booleans
# Variable names must start with a letter or _, and can have numbers. They are case sensitive.
myint = 10
myfloat = 13.2576
mystr = "This is a string"
mybool = True
# We can display the content of a variable using the print() function
#print(myint)
#print(mystr)
# Operators are used to perform operations on variables
# print(myint + myfloat)
# print(myint * myfloat)
# print(myint / myfloat)
# print(myint % 3)
# another_str = "This is another string"
# print(mystr + another_str)
# print("nom " * 3)
# Logical and comparison operators
# print(myint == 10)
# print(myfloat != 20)
# print(myint > 20)
# print(myfloat < 10)
# print(not(myint > 5 and myfloat < 25.0))
# re-declaring a variable works
myint = "abc"
print(myint)