happens if you divide by zero. We\'ll handle that condition later. Make sure tha
ID: 3850751 • Letter: H
Question
happens if you divide by zero. We'll handle that condition later. Make sure that something like 0 10/5 is 2 and not 0.5. 6.11. Square roots write the 5th case so that it does square roots. Do a bit of research using your book interwebs to determine how to do square roots in Python. This case does not need to input from the user. does the square root on the value already in the accumulator. T the program, but make sure you start with a positive number in the accumulator. Then add an ifelse statement inside this part of the program that checks to see if the accumulator is negative. If it is not negative, do the square root normally. If it is negativ the message "Not taking square root of negative number and leave the accumulator the way it is. It will be written sort of like this: if opt 1: stuff elif opt 2: stuff elif opt 5: check if the accumulator is negative if something: do something e use do something etse else stuff 6.12. Clear the accumulator For case 6 just store the value o o into the accumulator variable. This works just like theExplanation / Answer
1.n= Input a number: is not neccessary because it is automaticaly takes value from the accum not need to given user value
2.Before giving if statement Initialize a values in accumulator upto the size which user can required.
3.For each elif statement the print statement should written beacuse it is used to assing the value.
4.checking the accumulator value whether it is positive or negative
num =float(input("Input a number)
if num>0:
print("It is positive number")
num_sqrt=num **0.5
print ("the sqrt of num=(num,num_sqrt"))
elif num ==0:
print ("Its is Zero")
else
print (It is a Negative number")
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.