-
Notifications
You must be signed in to change notification settings - Fork 0
/
lesson_4.py
130 lines (119 loc) · 2.45 KB
/
lesson_4.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
130
# mylist = ['apple', 'banana', 'cherry', 1, 2, 3, 4, 5,
# {'a': 1, 'b': 1, 'c': 1, 'd': 1}]
# print(len(mylist))
#
# string = 'Hello'
# print(len(string))
#
# d = {'a': 1, 'b': 1, 'c': 1, 'd': 1}
# key= list(d.keys())
# values = list(d.values())
# print(len(d))
#
# mystr = "Привет Python!"
# underline = '-' * len(mystr)
# print(f'{underline}\n{mystr}\n{underline}')
#
# new_list = [0, 1, 2, 3, 4]
# print(type(new_list))
# for number in new_list:
# print(number)
#
# # ==================================
#
# import random, time
# print(time.time())
# time.sleep(5)
# print(time.time())
# print(random.randrange(3, 9))
# print(list(range(100,1, -1)))
# for num in range(0,100,20):
# # for num in range(0,5,1):==>range(5)
# for num in range(10):
# print(num)
# else:
# print("Числа закончились")
# ==================================
# for num in range(5):
# if num == 3:
# print(num)
# break
# else:
# print(num)
# else:
# print("Числа закончились")
# # ==================================
#
# for num in range(5):
# if num == 3:
# continue
# else:
# print(num)
# else:
# print("Числа закончились")
# ====================================
# i = 0
# while i < 5:
# print(i)
# i += 1
# else:
# print("Конец")
# # ====================================
# i = 0
# while i < 5:
# if i == 3:
# break
# else:
# print(i)
# i += 1
# else:
# print("Конец")
# # ====================================
# i = 0
# while i < 5:
# if i == 3:
# i += 1
# continue
#
# else:
# print(i)
# i += 1
# else:
# print("Конец")
# import time
#
# end_time = time.time() + 20
#
# while time.time() < end_time:
# print("Ok lets wait 5 sec")
# time.sleep(5)
# else:
# print("Alarm")
#
# def generator(rang):
# for num in range(rang):
# yield num
#
#
# generator(10)
# """
# This is program written for finding the max power of two, which will be no more than given number
# """
#
# N = int(input('Choose your number: '))
# n = 1
# pow = 0
#
# while N >= n:
# n *= 2
# pow +=1
# else:
# print(int(n/2), 'is the max power of 2, which is no more than your number. It is 2 in the power of', (pow-1))
n1 = int(input("Введите число: "))
n2 = 0
while n1 > 0:
digit = n1 % 10
n1 = n1 // 10
n2 = n2 * 10
n2 = n2 + digit
print(n2)