-
Notifications
You must be signed in to change notification settings - Fork 0
/
Task2.py
88 lines (77 loc) · 1.96 KB
/
Task2.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
# Homework ---> ATABEK
# Part 1
# 1)
# a = 'Amantay! '
# b = 'Alina! '
# c = 'Tilek! '
# string = 'Hello '
# lunch = 'Come for lunch today.'
# print(string + a + lunch)
# print(string + b + lunch)
# print(string + c + lunch)
# 2)
# spisok= ['Amantay', 'Alina', 'Tilek', 'Syimyk', 'Artur']
# new_spisok = spisok.copy()
# new_spisok[2] = 'Bektur'
# a = "Tilek cannot come today! "
# b = "Hello, "
# lunch = 'Come for lunch today.'
# print(b + str(spisok) + lunch)
# print(a + b + str(new_spisok) + lunch)
# 3)
# spisok= ['Amantay', 'Alina', 'Tilek', 'Syimyk', 'Artur']
# spisok.insert(0, 'Amanali')
# spisok.insert(2, 'Hakim')
# spisok.insert(7, 'Nurzhan')
# # print(spisok)
# b = "Hello, "
# lunch = 'Come for lunch today.'
# print(b + str(spisok) + lunch)
# 4)
# spisok = ['Syimyk', 'Artur']
# spisok.insert(0, 'Amanali')
# spisok.insert(2, 'Hakim')
# spisok.insert(7, 'Nurzhan')
# i = spisok.index('Syimyk')
# e = spisok[-1]
# d = spisok[-3]
# removed_item = spisok.pop(i)
# spisok.remove(e)
# spisok.remove(d)
# print(' Unfortunetely you guys are not coming: ' + e + ' ' + d)
# print(' Only you guys are coming: ' + str(spisok))
# 5)
# suitcase = ['phone', 'laptop', 'napkin', 'glasses', 'shampoo']
# suitcase.append('toothbrash')
# suitcase.append('pen')
# suitcase.pop()
# suitcase.insert(0,'notebook')
# print(suitcase)
# First Tasks Homework ---> ATABEK (Metody Spiskov(T1))
# 1)
# name = ['John', 'Jessica', 'Jerry', 'Tom', 'Ben']
# print(name[0])
# print(name[1])
# print(name[2])
# print(name[3])
# print(name[4])
# 2)
# name = ['Mers', 'Lexus', 'BMW']
# bold = 'My favorite car is '
# bold2 = 'I like '
# bold3 = 'cars!'
# print(bold + name[0])
# print(bold2 + name[1] + ' ' + bold3)
# 3)
# numbers = ['str1 ', 'str2 ']
# a = (numbers[ -1 ])
# b = (numbers[ 0 ])
# print(a + b)
# 4)
# spisok = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13]
# length = len(spisok)
# number = length // 2
# slice1 = spisok[0:number]
# slice2= spisok[number::]
# answer = slice2 + slice1
# print (answer)