Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Python 3

Name: Anonymous 2010-11-10 1:45

I just want to ask you a question
I just try learning python 3 and realize that the input and print don't work the way I wanted

print ("A program to add up some ages")

name = input("What is your name? ")

age1 = int(input("How old are you? "))
age2 = int(input("How old is your partner? "))

print ("Between you,",name,", you are",age1+age2,"years old")

It's supposed to generate
Between you, Name , you are 20 years old

But it keeps printing
Between you, Name
 , you are 20 years old

wat do?

Name: Anonymous 2010-11-10 2:03

python 3
Now you have two problems.

Name: Anonymous 2010-11-10 2:38

You could try print(..., sep=" "), though the default 'sep' value ought to be a single space anyway. You ought to check out the help text (docstrings) for these functions, ala help(print), etc.

>>2
Luddite.

Name: Anonymous 2010-11-10 3:12

>>3
Luddite
That word doesn't mean what you think it means.

Name: Anonymous 2010-11-10 3:29

Nevermind
The problem is with the IDE, eclipse/pydev

Name: Anonymous 2010-11-10 6:18

chomp(name)

Name: Anonymous 2010-11-10 11:29

wat do?
I don't mind stupidity, but please keep it to the imageboards.

Name: Anonymous 2010-11-10 13:14

>>7
I don't mind faggotry, but please keep it to yourself, ``faggot''.

Name: Anonymous 2010-11-10 14:20

>>1
name = input("What is your name? ").strip()

Name: Anonymous 2011-02-04 17:36

Name: Anonymous 2011-02-17 19:45

check 'em
Don't change these.
Name: Email:
Entire Thread Thread List