forked from LKnopf/Python_precourse
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhomework_1.py
More file actions
35 lines (25 loc) · 924 Bytes
/
Copy pathhomework_1.py
File metadata and controls
35 lines (25 loc) · 924 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
# fill the python code
# 1. assign an integer to the variable x
# 2. assign the content of x to the variable y
# 3. increase the content of x by 13
# 4. decrease the content of y by 3
# 5. assign an empty list to the variable z
# 6. put x and y in this list
# 7. run this file in Python3 and make sure no error occurs
# 8. push this file in your repository
x = 5
y = x
x = x + 13
y = y - 2
z = []
z.append(x)
z.append(y)
if __name__ == '__main__':
assert type(x) is int, 'x is not an integer anymore'
assert type(y) is int, 'y is not an integer anymore'
assert type(z) == list, 'z is not a list'
assert len(z) <= 2, 'list length is too long'
assert len(z) >= 2, 'list length is too short'
assert type(z[0]) == int, 'first element in the list is no integer'
assert type(z[1]) == int, 'second element in the list is no integer'
print('Congratulations, homework successfully solved!')