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 python3 main.py command.
The output should look like Figure 2.5 shown below:
PF1e_2-1B-figure-2.5.png
Figure 2.5
Task #01: 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
Link Copied!

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

blur-text-image
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

blur-text-image_2

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

blur-text-image_3

See step-by-step solutions with expert insights and AI powered tools for academic success

  • tick Icon Access 30 Million+ textbook solutions.
  • tick Icon Ask unlimited questions from AI Tutors.
  • tick Icon Order free textbooks.
  • tick Icon 100% Satisfaction Guaranteed-or Get a Refund!

Claim Your Hoodie Now!

Recommended Textbook for

Relational Database Design With Microcomputer Applications

Authors: Glenn A. Jackson

1st Edition

0137718411, 978-0137718412

More Books
flashcard-anime

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

Students Have Also Explored These Related Databases Questions!