Question: Answer R 3 . 3 by copying the code over and then fixing it ( with comments to explain what you change ) . Note

Answer R3.3 by copying the code over and then fixing it (with comments to explain what you change). Note that the fact that x,y,grade, and sum are not defined is not the error - just set x =0, y=0, sum =0, and grade=75 before running the parts. Hint: For part (b), something is missing to make sqrt() work... Note: In part (d), you cannot type in xStr = int(input("Enter an integer value "))- the int() cast there defeats the purpose of looking at the string to see if it's a digit or not in the rest of part (d). Find the errors in the following if statements. a. if x >0 then print(x)
b.if1+x>x**sqrt(2): y=y+x
c. if x =1 : y+=1
d. xStr = input("Enter an integer value") x = int(xStr)if xStr.isdigit() :
sum = sum + x
else :
print("Bad input for x")

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!