-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02_var.py
More file actions
46 lines (32 loc) · 1.05 KB
/
Copy path02_var.py
File metadata and controls
46 lines (32 loc) · 1.05 KB
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
39
40
41
42
43
44
45
46
# Variables
my_string_variable = "My String variable"
print(my_string_variable)
my_int_variable = 5
print(my_int_variable)
my_int_to_str_variable = str(my_int_variable)
print(my_int_to_str_variable)
print(type(my_int_to_str_variable))
my_bool_variable = False
print(my_bool_variable)
# String of variables on a print
print(my_string_variable, my_int_variable, my_bool_variable)
print("This is the value of:", my_bool_variable)
# Some system functions
print(len(my_string_variable))
# Variables in a single line
name, surname, nickname, age = 'Mike', 'Treyu', 'miketreyu', 'XX'
print('My name is:', name, surname, '. I am:', age, 'years old, and my nickname is', nickname)
# Inputs, we use them mainly in scrips for bash, cmd, etc
name = input('What is your name?:')
age = input('How old are you?')
print(name)
print(age)
# We can change the class/type
name = 35
age = 'mike'
print(name)
print(age)
# Can we force the type/class? It is more efficient if we use that with inputs. Python's types are dinamic.
adress: str = 'My adress'
adress = 32
print(adress)