Hi,
I have been experimenting with the Pydev plugin for the Eclipse IDE. I had hoped that the console would be fully interactive in the same way as the python idle.
If I write a program that has a print statement, for example, this is displayed in the console view, but what if I want to initiate a new class and check that it is working correctly which will involve actually typing in some code to see what values are returned etc.?...
User Profile
Collapse
-
If you do't mind being patient once more, can this be simplified :-
if namestring != 'Rachel' and namestring != 'Jack' and namestring != '': -
Thanks for all the help. You've been patient!!!
Heres something funny. I copied your code with debug points into a new window, saved it as a new file and ran it. It worked fine. Then I took all of your debug points out and ran it again. It worked perfectly.
Then I loaded my original code and it wouldn't run, yet line by line it looks exactly the same. I can't explain that I'm afraid :-)
Thanks again
...Leave a comment:
-
By the way, I think the names should be capitalized, but there is no difference when i do this.
tLeave a comment:
-
Hi,
This is the code. I was just playing around with a simple program that would amuse kids and would teach me about using
simple loops.
the age value always seems to be 0. I would also like a bit of code to ask the name again if the wrong name was input.
thanks!!!
...Code:from time import sleep age = 0 print 'hello' sleep(5) print 'I bet I can tell whether you are telling
Leave a comment:
-
I had given age an initial value age = 0 at the start of the program, but this isn't in the loop by the way
timLeave a comment:
-
Thanks for all the help, but one last question!!!
Now, even if the name is entered correctly and assigned to namestring, the age value is not altered.
Any ideas?
Thanks,
TimLeave a comment:
-
the age is indented by the way. It just did not show on the message
timLeave a comment:
-
Thanks for the replies. I've solved most of the problem. Can someone tell me why this dooes not work
namestring = input("WHAT IS YOUR NAME?" )
while namestring == 'Jack':
age = 9
while namestring == 'Rachel':
age = 7
I'm trying to set a value for age depending on what name was entered.
Also, is there a way to make Python ignore upper,lower case or a command along th...Leave a comment:
-
Loops (and the in operator) [solved]
Hi,
I'm new to Python and OO in general. I am trying to set up a simple loop based around an inputed answer to a question, so that if you input a wrong answer, you are asked the question again, but if correct, the program moves on.
For example:
What is the capital of France?
Correct answer - move on to next question. Wrong answer. Repeat the question
I used to write in basic years ago in...
No activity results to display
Show More
Leave a comment: