Re: [Tutor] Python input function not working in 2.7 version

2012-10-24 Thread Alan Gauld
On 24/10/12 13:22, Mark Lawrence wrote: On 24/10/2012 12:15, Morten Engvoldsen wrote: [duplicate question snipped] Thanks for asking the same question here that you asked on c.l.py 38 minutes previously. It's a reasonable question for the tutor list and it seems reasonable that somebody on

Re: [Tutor] Python input function not working in 2.7 version

2012-10-24 Thread eryksun
On Wed, Oct 24, 2012 at 10:18 AM, Morten Engvoldsen wrote: > > grams = eval(raw_input("How many grams? ")) > > Is it good practice to write code in this way. That's equivalent to using input(). http://docs.python.org/library/functions.html#input It's not generally a good practice. Sometimes it

Re: [Tutor] Python input function not working in 2.7 version

2012-10-24 Thread eryksun
On Wed, Oct 24, 2012 at 7:15 AM, Morten Engvoldsen wrote: > > I am facing issue with input() of Python 2.7 > > >fat_grams = input("How many grams of fat are in one serving? ") >total_calories = input("How many total calories are in one serving? ") >print("A food product having {0}

Re: [Tutor] Python input function not working in 2.7 version

2012-10-24 Thread Mark Lawrence
On 24/10/2012 12:15, Morten Engvoldsen wrote: [duplicate question snipped] Thanks for asking the same question here that you asked on c.l.py 38 minutes previously. -- Cheers. Mark Lawrence. ___ Tutor maillist - Tutor@python.org To unsubscribe or

Re: [Tutor] Python input function not working in 2.7 version

2012-10-24 Thread Dave Angel
On 10/24/2012 07:15 AM, Morten Engvoldsen wrote: > Hi, Hi. Welcome to the list. > I am facing issue with input() of Python 2.7. When i run the program it > doesn't display any line to take user input . Below is the code: > > def user_input() Need a trailing colon here. >fat_grams = input("Ho

[Tutor] Python input function not working in 2.7 version

2012-10-24 Thread Morten Engvoldsen
Hi, I am facing issue with input() of Python 2.7. When i run the program it doesn't display any line to take user input . Below is the code: def user_input() fat_grams = input("How many grams of fat are in one serving? ") total_calories = input("How many total calories are in one serving? ")