M
M
Maxim Knyazev2021-06-06 01:10:33
Python
Maxim Knyazev, 2021-06-06 01:10:33

How to write input to string with print in python?

Good day. It is necessary that the age was written out in one line. Is it possible to do this between + ? Or is there an alternative way? Writing on every new line is not appropriate. Thanks in advance for your reply
60bbf65489484272294837.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
lil.fxrrx, 2021-06-06
@Awelones

j = input("How old are you?: ");print("You are "+j+" years old.")

B
Bergis, 2021-06-06
@Bergis

print('you '+input() + 'yo')

M
MinTnt, 2021-06-06
@MinTnt

Well... Two main ways:

m = input('Возраст: ')
print('Вам ' + m)

print('Возраст: ', end='')
m = input()
print('Вам ' +m)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question