Question
THIS IS A SIMPLE HIGH SCHOOL COMPUTER SCIENCE COURSE IN PYTHON . PLEASE KEEP IT SIMPLE , THANK YOU! QUESTION #1 Write a program that
THIS IS A SIMPLE HIGH SCHOOL COMPUTER SCIENCE COURSE IN PYTHON. PLEASE KEEP IT SIMPLE, THANK YOU!
QUESTION #1
Write a program that asks the user to enter ten temperatures and then finds the sum. The input temperatures should allow for decimal values.
Sample Run
Enter Temperature: 27.6 Enter Temperature: 29.5 Enter Temperature: 35 Enter Temperature: 45.5 Enter Temperature: 54 Enter Temperature: 64.4 Enter Temperature: 69 Enter Temperature: 68 Enter Temperature: 61.3 Enter Temperature: 50 Sum = 504.3
QUESTION #4
Use built-in Python functions to determine what is returned in each of the following scenarios.
1. The character represented by the ASCII number that represents 32 + your birth month
For example: I was born in May. 32 + 5 = 37. print(chr(37)) returns %
2. The length of your full name
For example: print(len("Lindsay Frances Gilmour")) returns 23
3. The ASCII numbers that represent your initials
For example: print(ord("L")) returns 76 print(ord("F")) returns 70 print(ord("G")) returns 71
Info:
Name: Troy Kennedy Womack-Henderson
Birth Month: March
QUESTION #3
What would be the output of the following code?
w = "my Mom wants me 2 B a Teacher when i am older."
w.lower()
w.capitalize()
w.replace(" 2 ", " to ")
w.replace(" b ", " be ")
w.replace("i", "I")
print(w)
QUESTION #4
Write a program to generate passwords. The program should ask the user for a phrase and number, and then create the password based on our special algorithm. The algorithm to create the password is as follows:
- If the users input word is less than 8 characters, output Password not long enough.
- If the users input word is greater than or equal to 8 characters, do the following:
- Replace es with @
- Replace s or S with $
- Replace t or T with +
- Capitalize the word and add the number to the end.
Sample Run
Enter your word: zebras Enter a number: 62 Password not long enough. Enter your word: newyorkcity Enter a number: 892 Password: N@wyorkci+y892
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started