-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path01_variables.py
53 lines (36 loc) · 1018 Bytes
/
01_variables.py
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
47
48
49
50
51
# Variables
my_string_variable = "This is my first string" # snake case is the Python convention for variables
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 = True
print(my_bool_variable)
print("El valor es:", my_bool_variable)
print(my_string_variable, my_int_variable, my_bool_variable)
print('Hello', ',', 'World')
print(len(my_string_variable))
# Variables en una sola linea -- not good practice
name, surename, age, valor = "John", "Dobey", 45, True
print(name, surename, age, valor)
#Person info
person_info = {
'name1': 'Alberto',
'surename1': 'Ramirez',
'surename2': 'Cardozo',
'age1': 50,
'bool1': True
}
print(person_info)
# Data entry
first_name = input("What's your name? ")
age = input("How old are you? ")
print(first_name)
print(age)
# Change Data Type
first_name = 50
age = "Alberto"
print(first_name)
print(age)