Use (((Python))) (Find the number of years and days) Write a program that prompt
ID: 641612 • Letter: U
Question
Use (((Python)))
(Find the number of years and days) Write a program that prompts the user to enter the minutes (e.g., 1 billion), and displays the number of years and days for the minutes. For simplicity, assume a year has 365 days. Here is a sample run: Enter the number of minutes: 1000000000 1000000000 minutes is approximately 1902 years and 214 days (Split digits) Write a program that prompts the user to enter a four-digit integer and displays the number in reverse order. Here is a sample run: Enter an integer: 3125 3 1 2 5Explanation / Answer
def main():
min = int(input('Enter the number of minutes: '))
days = int(min / 1440)
years = int(days / 365)
days -= (365 * years)
print(str(min) + ' minutes is approximately ' + str(years) + ' years and ' + str(days) + ' days')
main()
_______________________________________________________________________________
def main():
num = int(input('Enter an Integer: '))
for i in range(4):
print(num % 10)
num = int(num / 10)
main()
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.