Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Last revision Both sides next revision | ||
lehrkraefte:blc:informatik:ffprg1-2020:zufallszahlen [2021/02/11 13:18] Ivo Blöchliger [Zufallszahlen] |
lehrkraefte:blc:informatik:ffprg1-2020:zufallszahlen [2021/04/09 16:47] Ivo Blöchliger |
||
---|---|---|---|
Line 10: | Line 10: | ||
print(random.random()) | print(random.random()) | ||
- | print(" | + | # Ich bevorzuge |
- | for i in range(10): | + | |
- | print(random.randint(1, | + | |
print(" | print(" | ||
for i in range(10): | for i in range(10): | ||
print(random.randrange(4)) | print(random.randrange(4)) | ||
+ | |||
+ | # Ich rate von random.randint ab und empfehle random.randrange | ||
+ | print(" | ||
+ | for i in range(10): | ||
+ | print(random.randint(1, | ||
</ | </ | ||
+ | '' | ||
+ | |||
Detaillierte Übersicht: https:// | Detaillierte Übersicht: https:// | ||