+ 1

Why this code doesn't work any_thing= 12 print("the best person is " + any_thing )

any_thing= 12 print("the best person is " + any_thing )

14th Feb 2022, 2:09 PM
ZIZO Abd alkawy
6 Réponses
+ 5
ZIZO Abd alkawy , you can do it also without converting : any_thing= 12 print("the best person is", any_thing)
14th Feb 2022, 5:04 PM
Lothar
Lothar - avatar
+ 4
Because any_thing is an integer type. You cannot concatenate string and integer like how you have tried. While printing do + str(any_thing)
14th Feb 2022, 2:15 PM
Avinesh
Avinesh - avatar
+ 3
any_thing= 12 print("the best person is " + str( any_thing))
14th Feb 2022, 2:15 PM
NEZ
NEZ - avatar
+ 1
Avinesh NEZ thanks
14th Feb 2022, 2:20 PM
ZIZO Abd alkawy
0
Semicolon i think
15th Feb 2022, 10:14 AM
Bharath