Computer Science, asked by hariniv7, 6 months ago

Find the error if any in the following code : (2)

a) x = input(“Enter any number:”)

Note: The input is X

b) a = input()

b = int(input())

c = a + b

print(c)

Note: Input is 10 and 5

Answers

Answered by Anonymous
0

Answer:

a) Is correct

b) Is incorrect

Explanation: b) is wrong as in variable a the input data(10) will in string

a = "10"

while variable b the input data(5) is converted into integer type

b = 5

so variable c cannot add string and integer datatype.

Similar questions