Ask coding questions

← Back to all posts
How to join inputs in Python?
RixTheTyrunt

OK, hello everybody again, I want to ask YOU... How to join inputs in Python? Maybe "..." + "..."?.. How do you think?

Answered by Coder100 [earned 5 cycles]
View Answer
Comments
hotnewtop
xfinnbar

input() returns a string. You can join two strings together using +:
str1 + str2.

RixTheTyrunt

@xfinnbar Hmm... How to convert a variable count from a number into a string?

Coder100

str(count) @SnackyPlusPlus

RixTheTyrunt

@Coder100 Another perfect answer! Keep going!

Coder100

Use the '+' operator.
Do note you can only do it for strings and numbers, otherwise you have to type cast.

Anyways, here's how: