-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvars.py
35 lines (31 loc) · 1.15 KB
/
vars.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
# Variablentypen können sich ändern!!!
# keine Typdeklarationen!
a = 100
print(a, type(a))
a = 3.1415
print(a, type(a))
a = "Hallo"
print(a, type(a))
# mathematische Operatoren
# + Addition
# - Subtraktion
# / Division
# * Multiplikation
# ** Potenzierung
# // Ganzzahl Division
# % Modulo
print(10/3) # 3.3333333333333335
print(10//3) # 3
print(10%3) # 1
print(2**16) # 65536
# Verwendung beliebig großer Ganzzahlen in Python 3
x = 4096**16
x = x * x * x * x * x * x * x * x * x * x * x
print(x)
# 5961435402259919231463024166884583412892034746745530627929931270338533657650185881977225675519
# 7729550821532303179315505715394602563194334944356646470358396036478221688471865563795537188388
# 9285523680681542682622992485998454422254346205188269982058330848165814218528432304958458516472
# 6753211999235764361287461940400303881878136547069613128527880477609146405199734391821882227560
# 1742466482123098161616211176297337119227890891094103114704555573850683425472851712481275679058
# 3181174762115337827697771072593076558961853936203969690859453400618497370766001868317217344149
# 071638768630396860838478405181466899321747678290733613480879657473540096