[Solved] SOLVED:Juggle

$25

File Name: SOLVED:Juggle.zip
File Size: 122.46 KB

SKU: [Solved] SOLVED:Juggle Category: Tag:
5/5 - (1 vote)

(While Loop Juggling, 10pt) Write a function juggle(n) that calculates a sequence of numbers as follows: it starts with n. If n is even, it replaces n with the floor of n**0.5; if, on the other hand, n is odd, it replaces n with the floor of n**1.5. (Recall that the floor rounds down a number, its available as a function in the math library, or you can use int()). And it doesnt do it just once, it keeps doing it until it hits n == 1, printing all the values of n it gets along the way. Here are two sample runs:

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] SOLVED:Juggle
$25