D335: Intro to Programming in Python - Lab #2 Guide [WGU]
Go to Inscribe for WGU (sign in with your WGU credentials) to view my solutions. This is basically like a GitHub repo for this class at WGU. The link to my profile is below. https://inscribe.education/main/wgu/6754110229503900/profiles/summary/6750868670481439 Practice these in your IDE (integrated development environment) of choice, such as PyCharm or VS Studio, or in a web-based compiler for Python: https://www.programiz.com/python-programming/online-compiler/ -------------------------------------- PRACTICE PROBLEM #1 # 60 seconds = 1 minute # 60 minutes = 1 hour # 3600 seconds = 1 hour Create a solution that takes an integer input representing a duration in seconds. Output the converted total number of hours, minutes, and remaining seconds based on the input seconds value. There are 60 seconds in a minute and 60 minutes in an hour. The solution output should be in the format: Hours: value_1 Minutes: value_2 Seconds: value_3 Sample Input/Output: If the input is 12500 then the expected output is Hours: 3 Minutes: 28 Seconds: 20 -------------------------------------- PRACTICE PROBLEM #2 # 1 feet = 12 inches # 3 feet = 1 yard # 1 yard = 36 inches Develop a solution that takes an integer input representing a length in inches. Output the converted total number of yards, feet, and remaining inches based on the input inches value. There are 36 inches in a yard and 12 inches in a foot. The solution output should be in the format: Yards: value_1 Feet: value_2 Inches: value_3 Sample Input/Output: If the input is 37 then the expected output is Yards: 1 Feet: 0 Inches: 1 -------------------------------------- TIMESTAMPS 00:00 - Introduction 00:52 - Walkthrough 05:35 - Modulo Explanation 08:15 - SKIP MODULO EXPLANATION 15:36 - Testing Code 19:58 - OA Advice & Closing
Download
1 formatsVideo Formats
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.