+ 1

How to output this code

a=10 b=(int(a) * int(a)) print(b+"Hello") Why i cant output this code? I want output=100Hello It shows some kind of error when i can't make int+string

6th Dec 2017, 8:48 AM
GramatickĂ˝ Komunista
GramatickĂ˝ Komunista - avatar
4 Answers
+ 12
correct code: a = 10 b = a * a print(str(b) + "Hello")
6th Dec 2017, 8:52 AM
Cool Codin
Cool Codin - avatar
+ 9
a = int(input("Enter a number")) b = a * a print("Hello" + str(b))
6th Dec 2017, 9:31 AM
Cool Codin
Cool Codin - avatar
+ 1
And how make a as input.. I mean this: a=input b=a * a print("Hello" + str(a))
6th Dec 2017, 9:29 AM
GramatickĂ˝ Komunista
GramatickĂ˝ Komunista - avatar
+ 1
Ok thanks :) Helped....
6th Dec 2017, 9:32 AM
GramatickĂ˝ Komunista
GramatickĂ˝ Komunista - avatar