Question: For this program you will convert knuts to sickles and galleons (Yes, Harry Potter here...). Your program should first prompt for the the number of
For this program you will convert knuts to sickles and galleons (Yes, Harry Potter here...). Your program should first prompt for the the number of knuts. Then perform the calculations: there are 29 knuts in one sickle and 17 sickles in one galleon. Print the results from the calculations. Be sure to print only non-zero values--that means if there are not enough knuts to be one sickle, then (as an example), "0 sickles" should not be printed.
how can i fix and improve this program
total_knut_int=int(input("enter the number of knuts:")) knut_int = 1 sickle_int = 29 gallions_int = 17*29
num_galleon =0 num_sickle = 0
while (total_knut_int < 0): print("enter a positive number:") if total_knut_int > 0: if total_knut_int > 0: num-galleon,rem = divmod(total_knut_int,galleon_int) if rem > 0: num_sickles, rem = divmod(rem,sicke_int) if num_galleon !=0: print("number of galleons:", num_galleon) if num_sickle !=0: print("number of sickles:", num_sickle) if rem !=0: print ("remainder of knuts:" , rem) else: print("imput is not more than zero")
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
