Re: Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Alvaro Lacerda
%s got the job done!!! Thank you all for the info and links, I appreciate it! -- http://mail.python.org/mailman/listinfo/python-list

Re: Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Hans Mulder
Hello, Python does not support REAL numbers. It has float number, which are approximations of real numbers. They behave almost, but not quite, like you might expect. It also has Decimal numbers. They also approximate real numbers, but slightly differently. They might behave more like you'd ex

Re: Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Peter Otten
Alvaro Lacerda wrote: > The code I wrote is supposed to ask the user to enter a number; > Then tell the user what's going to happen to that number (x / 2 + 5) ; > Then give the user an answer; > > I succeeded getting results from even numbers, but when I try diving an > uneven number (i.e. 5) by

Re: Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Vlastimil Brom
2012/12/30 Alvaro Lacerda : > The code I wrote is supposed to ask the user to enter a number; > Then tell the user what's going to happen to that number (x / 2 + 5) ; > Then give the user an answer; > > I succeeded getting results from even numbers, but when I try diving an > uneven number (i.e. 5

Re: Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Irmen de Jong
On 30-12-2012 23:37, Alvaro Lacerda wrote: > > I'm trying to get full number result using the %d command Try %f instead. %d is the formatting symbol for integer numbers. See http://docs.python.org/2/library/stdtypes.html#string-formatting-operations Or have a look at what string.format() can do:

Re: Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Joel Goldstick
On Sun, Dec 30, 2012 at 5:37 PM, Alvaro Lacerda wrote: > The code I wrote is supposed to ask the user to enter a number; > Then tell the user what's going to happen to that number (x / 2 + 5) ; > Then give the user an answer; > Try x / 2.5 + 5 > > I succeeded getting results from even numbers, b

Beginner: Trying to get REAL NUMBERS from %d command

2012-12-30 Thread Alvaro Lacerda
The code I wrote is supposed to ask the user to enter a number; Then tell the user what's going to happen to that number (x / 2 + 5) ; Then give the user an answer; I succeeded getting results from even numbers, but when I try diving an uneven number (i.e. 5) by 2, I get only the whole number (i.