-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainA.py
129 lines (110 loc) · 3.09 KB
/
mainA.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
# print("Jolanta")
#
# print("Hello")
#
# string = "My name is"
# print(string)
# print(type(string))
# print(type("Jolanta"))
# float = 1.99
# print(type(1.99))
# print(type(True))
# name_of_the_variable = "Jolanta"
# print(name_of_the_variable)
# dial_code = "+371"
# country = "LV"
# def print_the_number_of_the_country():
# print(f"I am from {country} and the dial code is {dial_code}")
#
# print_the_number_of_the_country()
#
# def add_two_numbers():
# print(1+2)
#
# add_two_numbers()
#
# def print_my_name():
# print("Hello User")
#
# print_my_name()
#name = input()
#surname = input()
#def my_name_is():
# print(f"May name is {name} {surname}")
#my_name_is()
""""Ā list can have different type of data. It can be a string, integer, float and a boolean"""
# list = ["Jolanta", 12, 1.99, True, False]
# print(list[0])
# print(list[4])
""""We know how to define string, integer, float, list and calling an element from the list"""
#
# dictionary = {"name": "Jolanta", "surname": "Ijannidi", "age": 38, "my_orders": [1, 2, 3, 4, 5]}
#
# json_formated = {
# "name": "Jolanta",
# "surname": "Ijannidi",
# "age": 38,
# "my_orders": [1, 2, 3, 4, 5]
# }
#
# print(len(dictionary))
# print(dictionary)
# print(dictionary["my_orders"])
#
# my_cv = {
# "name": "value",
# "experience": 1
# }
"""The moon missions are called as Apolo. There are 17 apolo missions and we are describing 3 out of them.
The missions 11 & 12 happened in 1969, on the months Jul and Nov. But the 13 on April 1970.
Out of the 3, apollo third was unsucessfull. The first moon landing was by apolo 11 by the
astronauts Neil Armstrong, Edwin Aldrin & Michael Collins.
Apolo 12 was with Astronauts, Charles Conrad, Alan Bean & Richard Gordon, whereas Apolo 13 had John Swigert,
James Lovell and Fred Haise."""
moon_mission_apolo = [
{"number_of_missions": 17},
{
"name_of_mission": "Apolo 11",
"month_of_mission": "Jul",
"year_of_mission": 1969,
"participants": ["Neil Armstrong", "Edwin Aldrin", "Michael Collins"],
"is_success": True
},
{
"name_of_mission": "Apolo 12",
"month_of_mission": "Nov",
"year_of_mission": 1969,
"participants": ["Charles Conrad", "Alan Bean", "Richard Gordon"],
"is_success": True
},
{
"name_of_mission": "Apolo 13",
"month_of_mission": "April",
"year_of_mission": 1970,
"participants": ["John Swigert", "James Lovell", "Fred Haise"],
"is_success": False
}
]
print(moon_mission_apolo[0])
year = moon_mission_apolo[2]["year_of_mission"]
if year > 1969:
print(year)
#mutable
list = [1, 2, 3]
#immutable - no update for tuple, use for example for year of production
tuple = ("a", "b", "c")
list.append(10)
print(list)
set = {1, 2, 3, 4, 5, 5, 100, 1000}
print(set)
""""Input function: sum(), print(), sort(), append(), max()"""
# print(input("Do you want to apply: (type yes)"))
""""Global variable"""
need_your_name = "Zane Ieva"
def welcome(name, surname):
print(f"Hello user {name} {surname}")
welcome("Jolanta", "Ijannidi")
# while True:
# voice = input()
# if voice == "alex":
# print("I am on")