CODING IN PYTHON: Please help with Python I want to see written code, not screen shots, please..
1. Write a Python program that will convert your height from feet and inches, to centimeters. Be sure to explain to possible users what the program will do.
2. Write a Python program to print the calendar of a given month and year.
NOTE: Use 'calendar' module.
3. Write a Python program that will take a number of feet being input by a user, and convert the feet to inches, yards, and miles. The results of this conversion will be displayed when the program is run.
PYTHON CODE:
# getting the data from the user
data=input("Enter your height in feet and inches(e.g 5 5 ,sep by space):")
# checking for valid data
if data:
# splitting the data by spaces
t=data.split()
# converting string into float
feet=float(t[0])
inches=float(t[1])
cm=0
# calculating the cm
cm=feet * 30.48 + inches * 2.54
# printing the result
print("%s Feet,%s Inches equivalent to %.2f cm" %(str(feet),str(inches),cm))
else:
print("There is no data to process.")
2. PYTHON CODE:
import calendar
# getting the month and year
m=int(input("Enter the month: "))
y=int(input("Enter the year: "))
# printing the calendar
print(calendar.month(y,m))
3. PYTHON CODE:
# getting the input
feet=float(input("Enter the feet: "))
# converting the feet to inches
inches=feet * 12
# converting the feet to yards
yards= feet * 0.333333
# converting the feet to miles
miles= feet * 0.000189393939
print("Feet: ",feet)
print("Inches: ",inches)
print("Yards: ",yards)
print("Miles: ",miles)
SCREENSHOT FOR OUTPUT:
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 3 images
- The process of finding the largest number is frequently used in computer applications. For example, a program that determines the winner in a sales competition will enter how many units each salesperson is selling. The staff with the most sales wins the contest. Write the program that enters 10 non-negative numbers and determines and writes the largest number. The programming language should be C. Thank you from now.arrow_forwardI need this in Python please and thank youarrow_forwardDon't give me AI generated answer or plagiarised answer.arrow_forward
- How can I do coding for this question?arrow_forwarddesign a program using pseudocode and then complete the program in Python using strings. Lab asks you to write a Mortgage Loan Calculator. Each lab asks you to write a pseudocode that plans the program’s logic before you write the program in Python and to turn in three things: 1) the pseudocode, 2) a screenshot of the output, and 3) the Python program.arrow_forwardwrite python program ?Every Sunday through Thursday you go to class. When it is raining you take an umbrellaBut on the weekend (Friday, Saturday), what you do depends on the weatherIf it is raining you read in bed Otherwise, you have fun outdoorsarrow_forward
- IN PYTHON Please! Suppose you deposit $100 into a savings account, and it accumulates at 6% interest compounded annually. Write a program to determine how long it takes (in years) to become a millionaire.arrow_forwardHello help me with these Python homeworks, please.arrow_forward4. CODE IN PYTHON Accept 5 integer inputs from the user and print the sum. Different in this exercise is that you cannot trust the user, just like in real life. You must validate that the input is actually an integer and cannot rely on the user always entering integers. If the user enters something other than a valid integer, print an error message and make them enter the number again until they enter 5 integers and you can print the sum.arrow_forward
- Find an example of a Python program on the Web that illustrates the program’s decisions using if and while statements. Provide a link for the source. What is happening in your programming example? Describe it in English as an algorithm. After the else statement executes, which program statement executes next in your example?arrow_forwardNote: Please do this in Python 3arrow_forwardAbout beginner python programming: - Imagine that you want to send a congratulations message and would like to repeat those congratulations many timestimes in the message. Something like “Happy Birthday!! Happy Birthday!! Happy Birthday!! ..." until fullyour friend's screen. You can write once and copy and paste. Then you notice, there in the middleof the way, that you typed wrong...Ouch! Now that you know how to use Python to make it work for you,do a function that receives as input a text and the desired number of repetitions and returns astring composed of n repetitions of this text. - so I know how to input a specific word in python and multiply it by a number but not how to input a string as a variable (which can be any word, text, expression) and multiply it.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education