Computer Science
Find the errors(s)
print ("Hello" + 2)
print ("Hello" + "2")
print ("Hello" * 2)
Python Data Handling
14 Likes
Answer
The line print ("Hello" + 2)
causes an error as addition operator (+) cannot concatenate a string and an int.
Answered By
7 Likes
Related Questions
Find the errors(s)
print ("Hello"/2) print ("Hello" / 2)
Find the errors(s)
pi = 3.14 print (type (pi)) print (type ("3.14")) print (type (float ("3.14"))) print (type (float("three point fourteen")))
What will be the output produced?
x, y, z = True, False, False a = x or (y and z) b = (x or y) and z print(a, b)
Find the errors(s)
print (type (int("123"))) print (type (int("Hello"))) print (type (str("123.0")))