Question: Write a while loop that prints user_num divided by 2 until user_num is less than 1. The value of user_num changes inside of the

Write a while loop that prints user_num divided by 2 until user_num

 

Write a while loop that prints user_num divided by 2 until user_num is less than 1. The value of user_num changes inside of the loop. Sample output with input: 20 10.0 5.0 2.5 1.25 0.625 Note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds and report "Program end never reached." The system doesn't print the test case that caused the reported message. Code writing challenge activity demo 456578.3058726.qx3zqy7 1 user_num= int(input()) 2 while user num>=1: 3 4 5 print (user_num/2) x-float(input()) user_num= x

Step by Step Solution

3.44 Rating (154 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

usernum intinput Looping till usernum ... View full answer

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!