What i'm doing wrong?


#1

I was trying to run this in PyCharm IDE following noob code:

a = input('Hello, what is your name? : ')
b = input('How old are you? : ')
c = input('How are you doing today? : ')

print ("Your_name is :" + a, "\nYou are :" + b + "years old", "\nAnd you are doing :" + c)

but it says

File "", line 1, in
NameError: name 'Ni' is not defined

Then i was trying to manage it via command line - that gives me another unexpected result:

File "first.py", line 6
print ' ------' + file_name
^

so i still don't understand what i'm doing wrong (guess i shall store variable value in array - but not sure).


#2

Hi Никита,

Although your syntax isn't exactly how I would write that code, it works fine for me: https://repl.it/CLBu


#3

Yes, but I found that variable stores only int() values and does not do it for str() like (my_name), can you please point me exactly where is the mistake?

I was trying to concatenate by int() values, but it's still won't work.

a = input('Hello, what is your name? : ')
b = input('How old are you? : ')
c = input('How are you doing today? : ')

print ('Your_name is :' + int(a), '\nYou are :' + int(b), '\nAnd you are doing :' + int(c))


#4

Ok, it works (sorry, i used wrong python version: 2.7 instead 3.5). Sorry once again.