Kent,

Thanks once again.
"I wonder if maybe you need to write some code? You talk about *reading* 
but you haven't mentioned *writing*. You can't learn to program without
writing programs - that would be like learning to write a foreign
language by reading books in the language - it helps but it won't get
you there!

So if you have just been reading, I suggest you try writing a few small
programs as warmups."

I think you are right on the money here. I need to write some more simple stuff. I did work through the books but I wrote very little on my own, just sort of followed along and said "Oh that makes sense". So I decided to go through the practice exercises in the book and then post here with any problems.

SO here is my first stab and I keep getting a syntax error in my first if statement. The = sign is highlighted and I cant figure out what is wrong. Im almost embarassed to mail this.
# A program that simulates flipping a coin 100 times and the reports the number of heads and tails that were flipped#

import random

heads = 0
tails = 0
flips = 0

if flips <= 100:

coin = random.randrange(2)

if coin = 0:
heads +=
elif coin = 1:
tails +=

flips +=1

print "The coin was flipped 100 times and it was heads" + heads + "times and tails" + tails + "times!"

raw_input("\n\nPress the Enter key to exit")

THanks,
Chris




New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to