in Python please. I have this so far def time(charge): if charge == 15 or charge == 20: return 0 elif charge == 35: return 6 elif charge == 60: return 7 elif charge == 120: return 16 You buy an international calling card to India. The calling card company has some special offers. If you charge your card with $15 or $20, you don't get anything extra. For a $35 charge, you get $6 of extra phone time. For a $60 charge, you get $7 of extra phone time. For a $120 charge, you get $15 of extra phone time. Write a function that asks the user for the amount he/she wants on the card and returns the total charge that the user gets. Note: Values other than those mentioned earlier are not allowed. Include appropriate comments to make your code more readable.
in Python please.
I have this so far
def time(charge):
if charge == 15 or charge == 20:
return 0
elif charge == 35:
return 6
elif charge == 60:
return 7
elif charge == 120:
return 16
You buy an international calling card to India. The calling card company has some special offers.
If you charge your card with $15 or $20, you don't get anything extra.
For a $35 charge, you get $6 of extra phone time.
For a $60 charge, you get $7 of extra phone time.
For a $120 charge, you get $15 of extra phone time.
Write a function that asks the user for the amount he/she wants on the card and returns the total charge that the user gets.
Note: Values other than those mentioned earlier are not allowed.
Include appropriate comments to make your code more readable.
Step by step
Solved in 2 steps with 1 images