|
|
|
@ -20,19 +20,23 @@
|
|
|
|
import cmath
|
|
|
|
import cmath
|
|
|
|
divmod(round(cmath.phase(0.2+0.8j),2)*20,3)
|
|
|
|
divmod(round(cmath.phase(0.2+0.8j),2)*20,3)
|
|
|
|
(8.0, 2.6000000000000014)
|
|
|
|
(8.0, 2.6000000000000014)
|
|
|
|
|
|
|
|
|
|
|
|
# Punkt 2
|
|
|
|
# Punkt 2
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
localTime = time.localtime()
|
|
|
|
localTime = time.localtime()
|
|
|
|
print("Current time: {}:{}".format(localTime.tm_hour, localTime.tm_min))
|
|
|
|
print("Current time: {}:{}".format(localTime.tm_hour, localTime.tm_min))
|
|
|
|
Current time: 15:31
|
|
|
|
Current time: 15:31
|
|
|
|
|
|
|
|
|
|
|
|
# Punkt 3
|
|
|
|
# Punkt 3
|
|
|
|
import random
|
|
|
|
import random
|
|
|
|
Days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
|
|
|
|
Days = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
|
|
|
|
random.sample(Days, 3)
|
|
|
|
random.sample(Days, 3)
|
|
|
|
['Friday', 'Saturday', 'Wednesday']
|
|
|
|
['Friday', 'Saturday', 'Wednesday']
|
|
|
|
|
|
|
|
|
|
|
|
# Punkt 4
|
|
|
|
# Punkt 4
|
|
|
|
random.choice(range(14, 33, 3))
|
|
|
|
random.choice(range(14, 33, 3))
|
|
|
|
17
|
|
|
|
17
|
|
|
|
|
|
|
|
|
|
|
|
# Punkt 5
|
|
|
|
# Punkt 5
|
|
|
|
import math
|
|
|
|
import math
|
|
|
|
N = math.floor(random.gauss(15, 4))
|
|
|
|
N = math.floor(random.gauss(15, 4))
|
|
|
|
@ -43,6 +47,7 @@ import string
|
|
|
|
letters = random.sample(string.ascii_letters, N)
|
|
|
|
letters = random.sample(string.ascii_letters, N)
|
|
|
|
letters
|
|
|
|
letters
|
|
|
|
['w', 'S', 'v', 'W', 'z', 'F', 'R', 'e', 'u', 'B', 'l', 'X', 'A', 'y']
|
|
|
|
['w', 'S', 'v', 'W', 'z', 'F', 'R', 'e', 'u', 'B', 'l', 'X', 'A', 'y']
|
|
|
|
|
|
|
|
|
|
|
|
# Punkt 6
|
|
|
|
# Punkt 6
|
|
|
|
timeDiff = round(time.time() - time.mktime(localTime))
|
|
|
|
timeDiff = round(time.time() - time.mktime(localTime))
|
|
|
|
print(timeDiff // 60, "minutes and", timeDiff % 60, "seconds")
|
|
|
|
print(timeDiff // 60, "minutes and", timeDiff % 60, "seconds")
|
|
|
|
|