Computer Science, asked by harshith5754, 8 months ago

Find the error A=input("value") B=a/2
Print(a, b)

Answers

Answered by Anish247
13

Value of A will be a string.

we can't divide a string with 2 that is done in B=a/2.

error is B=a/2

to solve this write like this

A=int(input("value"))

was it helpful

Answered by pruthaasl
1

Answer:

The error will be shown in the line b=a/2.

Explanation:

  • The first line of the code assigns the string "value" to the variable a.
  • This implies that the variable a is of string data type.
  • The next line of the code is to divide the contents of variable a by 2 and assign the result to variable b.
  • Since variable a is of string data type, division operation cannot be performed on it.
  • Hence, b=a/2 is an invalid operation.

Therefore, b=a/2 is the error in the given code.

#SPJ3

Similar questions