Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to or received from the Internet. **************************************************************** IDLE 1.2.2 >>> ================================ RESTART ================================ >>> Enter wins year1 Enter wins year2 Enter wins year3 Enter wins year4 Enter wins year5 Traceback (most recent call last): File "C:/Python25/python 1.5", line 6, in <module> averageWins=(year1+year2+year3+year4+year5)/5 NameError: name 'year1' is not defined >>>Please give me help
python exerciseneed help to run the python program
Page 1 of 1
5 Replies - 1768 Views - Last Post: 08 January 2009 - 06:57 PM
#1
python exercise
Posted 06 January 2009 - 07:22 PM
Replies To: python exercise
#2
Re: python exercise
Posted 06 January 2009 - 08:02 PM
Well, we will need to see source code to be positive, but it looks like you have the problem that you aren't actually asking for input, just acting like it.
Please post your code like so:
Please post your code like so:
#3
Re: python exercise
Posted 06 January 2009 - 08:58 PM
Thank you so much. You were right.I was missing the input
neekee711, on 6 Jan, 2009 - 06:22 PM, said:
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to or received from the Internet. **************************************************************** IDLE 1.2.2 >>> ================================ RESTART ================================ >>> Enter wins year1 Enter wins year2 Enter wins year3 Enter wins year4 Enter wins year5 Traceback (most recent call last): File "C:/Python25/python 1.5", line 6, in <module> averageWins=(year1+year2+year3+year4+year5)/5 NameError: name 'year1' is not defined >>>Please give me help
#4
Re: python exercise
Posted 06 January 2009 - 09:04 PM
LOL, no problem.
At DIC we be code psychics, with the occassional ninja thrown in.
At DIC we be code psychics, with the occassional ninja thrown in.
#5
Re: python exercise
Posted 07 January 2009 - 09:25 PM
neekee711, on 6 Jan, 2009 - 06:22 PM, said:
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. **************************************************************** Personal firewall software may warn about the connection IDLE makes to its subprocess using this computer's internal loopback interface. This connection is not visible on any external interface and no data is sent to or received from the Internet. **************************************************************** IDLE 1.2.2 >>> ================================ RESTART ================================ >>> Enter wins year1 Enter wins year2 Enter wins year3 Enter wins year4 Enter wins year5 Traceback (most recent call last): File "C:/Python25/python 1.5", line 6, in <module> averageWins=(year1+year2+year3+year4+year5)/5 NameError: name 'year1' is not defined >>>Please give me help
#6
Re: python exercise
Posted 08 January 2009 - 06:57 PM
What are you trying to do? If you want to take input from user, then try
...and so on.
year1=raw_input("Win:")
year2=raw_input("Win:")
...and so on.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote





|