+ 1
How can I print a result which shows how many heads and how many tails have been shown
Eg:- Heads Tails Tails Heads https://code.sololearn.com/c7wdLABs1tuw/?ref=app
4 odpowiedzi
+ 7
Sreeju ,
it is not seen as very helpful when we are going to post a ready-made code.
it is more helpful to give hints and tips, so that the op has a chance to find a solution by himself.
+ 3
import random
# Change range value to print more
for i in range(10):
coin = random.randint(1,2)
if coin == 2:
print("Heads")
else:
print("Tails")
+ 3
That's right
+ 1
Thank you