Ask coding questions

← Back to all posts
whats wrong with my code?
DanielCardwell

while count < 5:
import random

toss = random.randint(0,1)
if toss == 0:
print("Heads")
else:
print("Tails")
if count <= 5:
print(1)
else:
print(0)

Voters
DanielCardwell
Comments
hotnewtop
CosmicBear

If this is the full code: Besides the indenting, import random shouldn't be inside the loop, You probably shouldn't be printing integers, and count isn't defined.