Re: [Tutor] Loop

2011-06-04 Thread Alan Gauld
"Vincent Balmori" wrote you the number of heads and tails." Right now I am having trouble connecting the random.randint function into the loop. Break the problem statement down. You have correctly worked out that randint(1,2) will equate to tossing the coin. You want to do that 100 times

Re: [Tutor] Loop

2011-06-04 Thread Alexandre Conrad
Vincent, You will need to move the line that flips the coin: coin = random.randint(1,2) and the if/else logic *inside* the loop so it will be repeated as many times as needed. I'm not sure what you want to do with the input() inside the loop. Remove this. Alex 2011/6/4 Vincent Balmori : > H

[Tutor] Loop

2011-06-04 Thread Vincent Balmori
Hello. Right now I am learning the python language through Python Programming for the Absolute Beginner 3rd Edition. I am having trouble with one question in Ch. 3 #2, which says "Write a program that flips a coin 100 times and then tells you the number of heads and tails." Right now I am havin