Computer Science

Correct the following program so that it displays 33 when 30 is input.


val = input("Enter a value")
nval = val + 30
print(nval)

Python Funda

34 Likes

Answer

Below is the corrected program:


val = int(input("Enter a value"))    #used int() to convert input value into integer 
nval = val + 3    #changed 30 to 3
print(nval)

Answered By

27 Likes


Related Questions