Question

In: Computer Science

Using Python, use the following list (Temperature = [56.2,31.8,81.7,45.6,71.3,62.9,59.0,92.5,95.0,19.2,15.0]) to: - Create a loop to iterate...

Using Python, use the following list (Temperature = [56.2,31.8,81.7,45.6,71.3,62.9,59.0,92.5,95.0,19.2,15.0]) to:

- Create a loop to iterate through each of the elements in the temperature list.

- Convert each element of this list to a Celsius temperature and then, for each valid temperature in the list, print out both the original Fahrenheit temperature and the Celsius equivalent in this format: "32 degrees Fahrenheit is equivalent with 0 degrees Celsius."

Solutions

Expert Solution

NOTE:

Be clear with indentation error while copying the code it may casuse indentaion error.

solution:

program 1: Create a loop to iterate through each of the elements in the temperature list.

code:

Temperature=[56.2,31.8,81.7,45.6,71.3,62.9,59.0,92.5,95.0,19.2,15.0]
print("creating loop to iterate over the list")
for i in Temperature:
print(i)

OUTPUT:

creating loop to iterate over the list
56.2
31.8
81.7
45.6
71.3
62.9
59.0
92.5
95.0
19.2
15.0


scrrenshot:

program 2: each element of this list to a Celsius temperature and then,
for each valid temperature in the list,
print out both the original Fahrenheit temperature and the Celsius equivalent in this format:
"32 degrees Fahrenheit is equivalent with 0 degrees Celsius."

code:

Temperature=[56.2,31.8,81.7,45.6,71.3,62.9,59.0,92.5,95.0,19.2,15.0]
for i in Temperature:
c=(i-32)/1.8
print(i," degrees Fahrenheit is equivalent with ",c," degrees Celsius")

OUTPUT:

56.2 degrees Fahrenheit is equivalent with 13.444444444444446 degrees Celsius
31.8 degrees Fahrenheit is equivalent with -0.11111111111111072 degrees Celsius
81.7 degrees Fahrenheit is equivalent with 27.61111111111111 degrees Celsius
45.6 degrees Fahrenheit is equivalent with 7.555555555555556 degrees Celsius
71.3 degrees Fahrenheit is equivalent with 21.833333333333332 degrees Celsius
62.9 degrees Fahrenheit is equivalent with 17.166666666666664 degrees Celsius
59.0 degrees Fahrenheit is equivalent with 15.0 degrees Celsius
92.5 degrees Fahrenheit is equivalent with 33.61111111111111 degrees Celsius
95.0 degrees Fahrenheit is equivalent with 35.0 degrees Celsius
19.2 degrees Fahrenheit is equivalent with -7.111111111111112 degrees Celsius
15.0 degrees Fahrenheit is equivalent with -9.444444444444445 degrees Celsius


scrrenshot:


Related Solutions

PYTHON 1. Write a for loop to iterate across a user entered string in reverse order...
PYTHON 1. Write a for loop to iterate across a user entered string in reverse order Use an input statement to ask the user for a string using the prompt: Cheer? [space after the ?] and assign to a variable Start the for loop to iterate across the elements in the string in reverse order Display each element of the string on screen After the for loop ends, display the entire string 2. Write a for loop with a range...
must use python Write a nested for loop that displays the following output using the same...
must use python Write a nested for loop that displays the following output using the same integer from part a:                                                     1                                                 1   2   1                                             1   2   4   2   1                                         1   2   4   8   4   2   1                                     1   2   4   8 16   8   4   2   1                                 1   2   4   8 16 32 16   8   4   2   1                             1   2   4   8 16 32 64 32 16   8   4   2   1                         1   2   4  ...
Create a python code that calculates fixed point iteration method using a for loop.
Create a python code that calculates fixed point iteration method using a for loop.
USE PYTHON Create a single list that contains the following collection of data in the order...
USE PYTHON Create a single list that contains the following collection of data in the order provided: [1121, "Jackie Grainger", 22.22, 1122, "Jignesh Thrakkar", 25.25, 1127, "Dion Green", 28.75, False, 24.32, 1132, "Jacob Gerber", "Sarah Sanderson", 23.45, 1137, True, "Brandon Heck", 1138, 25.84, True, 1152, "David Toma", 22.65, 23.75, 1157, "Charles King", False, "Jackie Grainger", 1121, 22.22, False, 22.65, 1152, "David Toma"] The data above represents employee information exported from an Excel spreadsheet. Whomever typed the data in originally didn't...
Python: High school assignment, please keep simple In python: Use the following initializer list to create...
Python: High school assignment, please keep simple In python: Use the following initializer list to create an array: twainQuotes = ["I have never let my schooling interfere with my education.", "Get your facts first, and then you can distort them as much as you please.", "If you tell the truth, you don't have to remember anything.", "The secret of getting ahead is getting started.", "Age is an issue of mind over matter. If you don't mind, it doesn't matter. "]...
1. Write a python program to create a list of integers using random function. Use map...
1. Write a python program to create a list of integers using random function. Use map function to process the list on the expression: 3x2+4x+5 and store the mapped elements in another list. Now use filter to do sum of all the elements in another list. 2. Write a function that takes n as input and creates a list of n lists such that ith list contains first 10 multiples of i. 3. Write a function that takes a number...
USING PYTHON Write a program to create a number list. It will call a function to...
USING PYTHON Write a program to create a number list. It will call a function to calculate the average values in the list. Define main ():                        Declare variables and initialize them                        Create a list containing numbers (int/float)                        Call get_avg function that will return the calculated average values in the list.                                       Use a for loop to loop through the values in the list and calculate avg                        End main()
Please use Python to create a method for a linked list that returns the index of...
Please use Python to create a method for a linked list that returns the index of a lookup value within the linked lust
Important: please use python. Using while loop, write python code to print the times table (from...
Important: please use python. Using while loop, write python code to print the times table (from 0 to 20, incremented by 2) for number 5. Add asterisks (****) so the output looks exactly as shown below.   Please send the code and the output of the program. ****************************************************************** This Program Shows Times Table for Number 5 (from 0 to 20) Incremented by 2 * ****************************************************************** 0 x 5 = 0 2 x 5 = 10 4 x 5 = 20 6...
in python please Q1) Create a Singly link list and write Python Programs for the following...
in python please Q1) Create a Singly link list and write Python Programs for the following tasks: a. Delete the first node/item from the beginning of the link list b. Insert a node/item at the end of the link list c. Delete a node/item from a specific position in the link list Q2) Create a Singly link list and write a Python Program for the following tasks: a. Search a specific item in the linked list and return true if...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT