How to Use the Code Editor Select the Run Code button to execute the program. Select the Calculate Grade button to generate a score based
Answered step by step
Verified Expert Solution
Question
26 users unlocked this solution today!
How to Use the Code Editor
Select the "Run Code" button to execute the program.
Select the "Calculate Grade" button to generate a score based on the completed tasks.
Continue to modify, run, and calculate your code until you are happy with the grade.
Select the "Submit" button to turn in the assignment to your instructor.
Scenario
You are given the number of days that you have been driving, and you will write a Python script to work out the equivalent number of years and weeks.
Aim
Write a script that takes user input as days and converts the days into years, weeks, and days, and then prints them out. We can ignore leap years. The aim of this activity is to use different arithmetic operators to split days into years, weeks, and days.
Steps for Completion
Go to your main.py file.
On the first line, ask the user how many days they've been driving for and declare the user input. It's an integer, so cast the string.
Then calculate the number of years in that set of days.
Next, convert the remaining days that weren't converted to years into weeks.
Then, get any remaining days that weren't converted to weeks.
Print everything out.
Finally, run the script with the python main.py command.
The output should look like Figure shown below:
PFeBfigurepng
Figure
Task #: Generate the correct number of years, weeks, and days from user input.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1
To solve the problem of converting the number of days into years weeks and days you can write a Pyth... View full answer

Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
100% Satisfaction Guaranteed-or Get a Refund!
Step: 2Unlock detailed examples and clear explanations to master concepts

Step: 3Unlock to practice, ask and learn with real-world examples

See step-by-step solutions with expert insights and AI powered tools for academic success
-
Access 30 Million+ textbook solutions.
-
Ask unlimited questions from AI Tutors.
-
Order free textbooks.
-
100% Satisfaction Guaranteed-or Get a Refund!
Claim Your Hoodie Now!

Study Smart with AI Flashcards
Access a vast library of flashcards, create your own, and experience a game-changing transformation in how you learn and retain knowledge
Explore Flashcards