Ask coding questions

← Back to all posts
i need help
Alicat (3)

hi i need help with this thank you if you could help me thAT WOULD BE AWSON

chonkybitz (2)

You can take in the data immediately to a variable by changing the structure slightly.

fname = input('Enter name: ')
sname = input('Enter surname: ')
age = int(input('Enter age: ')) # will throw an error if not integer

print('Hello, {}. Your surname is {} and your age is {}.'.format(fname, sname, age))
legocjones (2)

print ("What is you name")
firstname = input()
print ("hello,",firstname)
print ("What is your surname")
surname = input ()
print ("your surname is,",surname)
print ("hello,",firstname,surname)
print("What is your age?")
age = int(input())
print("your age is", age)

XanderKleiber (20)

Try using \n to put line spacing in between lines. You could also put spaces after the questions (Both inside the quotation marks) to make it so that the names aren't connected to the questions.

TristanMisja (36)

On line 5 don't put a space in between input and (
Also, instead of using commas it's better you use + with spaces in between values.

Here is the repl:

jbryden (1)

this should neating it up a bit

firstname = input("What is you name")
print ("hello",firstname)
surname = input ("What is your surname")
print ("your surname is",surname)
print ("hello",firstname,surname)

AmirOcuzz (0)

What do you need help with?

x9 (2)

change line 5 from
surname = input ()
to surname = input()

AveryBanks (0)

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

erogers91 (0)

Have you tried:

print ("What is your age?")
age = input ()
print ('Your age is,',age, "!")```
Alicat (3)


ChiselD1 (0)

@Alicat What have you tried so far? Can you start by giving it a shot on your own? You learn a lot better that way, and then we can see what's going wrong and help you out.


@Alicat use an int or you can try printing your age as a string

west (99)

@Alicat You should be able to do this on your own based on what you already have. If you encounter a specific issue or do not understand why something produces a specific unexpected behavior try posting that.