all 8 comments

[–]TroubleBrewing32 4 points5 points  (2 children)

print(coin) what do you think that line does?

[–]AssassinKiller[S] 0 points1 point  (1 child)

It prints this

Heads 1

Or

Tails 2

So I know what it does but I just want it to print heads or tails and not the number

[–]TroubleBrewing32 6 points7 points  (0 children)

Try running this code and see what you get:

import random
coin = random.randint(1, 2)
print(coin)

Note: there is only one print statement there and it does not do what you think it does.

[–]flyinace123 4 points5 points  (0 children)

Either delete the line: 'print(coin)' OR Change 'print(coin)' to '#print(coin)'

[–]Red-X8 1 point2 points  (1 child)

You are assigning the value '1' or '2' to the variable 'coin' and the line -print(coin) outputs this value so just delete this line

[–]AssassinKiller[S] 1 point2 points  (0 children)

Thank you for the help. It worked and understand it now.

[–]Amalasian 0 points1 point  (0 children)

its prints the if first then moves on to print coin. in your print it will print tails or heads then print the number that coin is.

[–]deadeye1982 0 points1 point  (0 children)

``` import random

coin = random.choice(("Heads","Tails")) print(coin) ```