-
Notifications
You must be signed in to change notification settings - Fork 29
/
Copy pathtypes.py
117 lines (92 loc) · 1.05 KB
/
types.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
1
0
123
-1
1.1
1.0
1 + 1
2 - 1
3 * 4
1 / 2
1 / 0
1 // 2
1 % 2
2 ** 10
(1 + 3) * 4
a = 1
a
a = a + 1
a == 2
True
False
1 < 2
1 > 2
1 == 2
1 != 2
True or False
True and False
not True
type(1)
type(1 == 1)
"alma"
""
type("alma")
"alma" + "fa"
"alma" - "fa"
"alma" + 3
"alma" + str(3)
"alma" * 3
"a" in "alma"
len("alma")
"alma"[1]
"alma"[1:3]
int("123")
[1, 2, 3]
[]
[1, 2] + [3]
[1] - [2]
[1, 2] * 3
1 in [1, 2]
len([1, 2, 3])
arr = [1, 2, 3]
arr[0]
arr[1:3]
[] is []
None
if a == 2:
print(a)
if a == 2:
print("two")
else:
print("other")
if a == 1:
print("one")
elif x == 2:
print("two")
else:
print("a lot")
if a == 1:
pass
else:
print("not one")
# print odd and even on number input
a = 0
while a < 5:
a += 1
print(a)
# print the even numbers
# print every third number
# double all elements of a list
# sum a list
break
continue
# multiply two lists
for i in [1, 2, 3, 4]:
print(i)
# fizz 7
# buzz 3
# fizz buzz in number
# decide if prime number
# print prime numbers till 50
# fibonacci
# roman numberal