Z
Z
Zaloz2018-05-16 17:44:27
Python
Zaloz, 2018-05-16 17:44:27

How to display the required variables?

The problem is that the output of str is always quoted
. You need to do something like this:
>>>Enter a sentence: ABC
>>>Output: 532485789

А=532
Б=485
В=789
text = input("Введите предложение: ")
print("Вывод: "+text)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
DarkMode, 2018-05-16
@Zaloz

text = 'АБВ'
print(''.join([str(globals()[datapoint]) for datapoint in text]))

S
Sergey Ozeransky, 2018-05-16
@KREGI

print("Вывод: ", text)
print("Вывод: ", int(text))
print("Вывод: {0} ".format(int(text)))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question