0

How can I use both int and str in Python3.6?

num1 = int(input("NUMBER1"))
num2 = int(input("NUMBER2"))

print("NUMBER1 is" + num1)

I use '+' because I dont want space(_) between 'is' and 'num1'

This code has TypeError: must be str, not int.

How can I use both int and str in Python3.6?

or

How can I remove space(_) when I use comma(,)?

  • 3
    Apart from what's mentioned in the duplicate, with Python 3.6 you can also use [f-strings](https://docs.python.org/3/whatsnew/3.6.html#pep-498-formatted-string-literals): `print(f"NUMBER1 is{num1}")` – Georgy Apr 28 '18 at 12:46
  • 1
    I think that this: `print("NUMBER1 is", num1, sep="")` is what you are after. The`sep` defaults to space if you don't specify it. – figbeam Apr 28 '18 at 14:25

0 Answers0