Apr-28-2021, 01:28 PM
If run as script
In REPL it would be like this.
.py
file and not in REPL then there is no >>>
.import random def rand(): for i in range(6): print(random.randint(1, 40)) rand()
Output:22
35
8
12
21
29
if it's longer code with functions it can be better to run it as a script.In REPL it would be like this.
>>> import random >>> >>> def rand(): for i in range(6): print(random.randint(1, 40)) >>> rand() 22 2 12 14 29 26 >>>