|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
newbie needs comments/details
Code:
count = 1 #1 count is a variable
while count <= 10: # as long as variable is less than or equal to 10
if count != 5: #3 if variable is 5
print count #4 print variables
count = count + 1 #5
raw_input('press the enter key to exit')
# this code is suppose to print 1
2
3
4
6
7
8
9
10
please give comments and details for lines #3 #5 feel free to correct code and comments thanks ! Last edited by netytan : May 5th, 2004 at 10:02 AM. |
|
#2
|
|||
|
|||
|
#3 if the variable count does not equal 5
#4 print the value contained in the variable count #5 increment count; add one to the current value of count. please use code tags in future. |
|
#3
|
||||
|
||||
|
I see no reason why this code wouldnt print 1 though 10 - what exactly is the problem
. I have to insist that you use code tags perfect; not that i mind adding the code tags for you too much but it does make things easier if you would do it from now on!Mark. Last edited by netytan : May 5th, 2004 at 10:07 AM. |
|
#4
|
|||
|
|||
|
thanks, what exactly are code tags ?
|
|
#5
|
||||
|
||||
|
Check out the stickies:
http://forums.devshed.com/t131489/s.html http://forums.devshed.com/showthrea...t=109293&page=2 Mark. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > newbie needs comments/details |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|