This is what the teacher had us do in class so I'm going by what He had done to the code
Ps don't understand the white space thing.
This is what the teacher had us do in class so I'm going by what He had done to the code
Ps don't understand the white space thing.
This is the code the teacher had and I don't know if He was able to get it to run
P.S. not sure what the white space thing is about please explain TY.
it looks like a nested loop. prompt for type of food, then prompt for number of items repeatedly.
OP:
please reply, and click the '#' icon on the message window. then between the code tags, paste the code. it will look like my initial reply, if you preview it, with the code in a white box.
http://www.clarejohn.com/python1/python1.html
check out chapter for for flow control and whitespace.
whitespace is important in python
wont do the same asCode:def foo (bar): print bar
its basically like brackets in c.Code:def foo(bar): print bar
without whitespace your program wont work, thats your problem.
@doas777
the first loop just sets all the variables to 0, and that loop will finish at the same time as the second loop, its not wrong just a bit redundant.
Check out my little app. Tnote
your link is broken
http://www.greenteapress.com/thinkpy...inkpython.html
this is quite a good intro too
Check out my little app. Tnote
that link is broken also I tried them both
interesting. they both work fine for me. weird.
anyway, just google 'python tutorial flow control' and whitespace will be explained on whatever tutorial you land on. if it isn't, then it's a poor tutorial.
This is the third time I've tried to reply back Am hoping it goes thru this time Thanks for the help Am looking intoo the thinkpython again thanks.
I'm really green when it comes to code writting as you can tell.
Bookmarks