Question

In: Computer Science

Python Create a program Given the temperature of 100=> Sc=> 1 rooms on the third flow,...

Python Create a program
Given the temperature of 100=> Sc=> 1 rooms on the third flow, you simply have to identify the hottest of tthem. If two rooms have the sane temperature , then you should choose the one that has the highest pisition in the entry specification( the last to enter) Simple, right?
The first line of the entry is S, the number of rooms for this problem. In each of the following S lines there is a real number T <= 1000.00, which represents the temperature of the S- th rooms
Constraints
T (Temperature) is a real number.

Output Format
It Should print the position of the warmest room.

sample output
5
5.26
10.59
8.4
9.2
10.58
Sample input
6
5.26
10.59
8.4
9.051
10.58
10.59
Sample output 1
6


Solutions

Expert Solution

The program is given below: that take number of rooms from user, take temperature for s-th room from user, then find position of warmest room and print its position.

#take number of rooms from user
S=int(input(""))
temp=[]
#execute for loop upto S
for i in range(S):
#take temperature for s-th room from user
temp_1=float(input(""))
#check temperature taken from user is less than or eqaul 1000.00
if(temp_1<=1000.00):
#append temp_1 into temp array
temp.append(temp_1)
  
#set pos to 0
pos=0
#set warm_temp to temp[0]
warm_temp=temp[0]

#execute for loop upto S
for i in range(S):
#check warm_temp is less than or equal temp[i]
if(warm_temp<=temp[i]):
#set warm_temp to temp[i]
warm_temp=temp[i]
#set pos to i
pos=i
#print position of warmest room
print(pos+1)

The screenshot of code is given below:

Input Example 1:

5
5.26
10.59
8.4
9.2
10.58

Output Example 1:

2

Input Example 2:

6
5.26
10.59
8.4
9.051
10.58
10.59

Output example 2:

6


Related Solutions

1. Create a flow chart from the algorithm then create python code. Algorithm: Tell the user...
1. Create a flow chart from the algorithm then create python code. Algorithm: Tell the user to enter their name, how many cars the user has, and the average number of cars per family in the users state. Create a variable to show the difference between the users number of cars and the average number of cars per family. Print the values of name, number of cars, average number of cars, and the difference in 2 decimal places.
Given a strip commercial development near Columbia, SC, with the following characteristics: overland flow length =...
Given a strip commercial development near Columbia, SC, with the following characteristics: overland flow length = 180 ft on 2.1% grade over asphalt cover (n=0.011); shallow concentrated flow length of 1000 ft on 1.8% grade (paved gutter); drainage area = 5 acres; runoff coefficient = 0.60 Sheet flow travel time (minutes) =                            Shallow concentrated flow travel time (minutes) =                               Watershed time of concentration (minutes) =                          10-year design rainfall intensity (inches/hour) =                                  Runoff peak (cfs) for 10-year...
Using the Python program: a/ Write a program that adds all numbers from 1 to 100...
Using the Python program: a/ Write a program that adds all numbers from 1 to 100 to a list (in order). Then remove the multiples of 3 from the list. Print the remaining values. b/ Write a program that initializes a list with ten random integers from 1 to 100. Then remove the multiples of 3 and 5 from the list. Print the remaining values. Please show your work and explain. Thanks
Create a Python 3 program that acts as a grocery store shopping cart. 1. Create a...
Create a Python 3 program that acts as a grocery store shopping cart. 1. Create a class named GroceryItem. This class should contain: - an __init__ method that initializes the item’s name and price - a get_name method that returns the item’s name - a get_price method that returns the item’s price - a __str__ method that returns a string representation of that GroceryItem - an unimplemented method is_perishable Save this class in GroceryItem.py. 2. Create a subclass Perishable that...
Create a Python script in IDLE or Kali Python3 CLI to create the following Python Program:...
Create a Python script in IDLE or Kali Python3 CLI to create the following Python Program: Your program will create a username of your choice using a Kali Linux command "useradd -m mark", then set the password for that user using the Kali Linux Command "echo "mark:10101111" | chpasswd". Then you create a dictionary file using the Kali Linux command "crunch 8 8 01 > mylist.txt" Your python script should crack the password for that user and display on the...
I need to write this program in Python. Write a program that displays a temperature conversion...
I need to write this program in Python. Write a program that displays a temperature conversion table for degrees Celsius and degrees Fahrenheit. The tabular format of the result should include rows for all temperatures between 70 and 270 degrees Celsius that are multiples of 10 degrees Celsius (check the sample below). Include appropriate headings on your columns. The formula for converting between degrees Celsius and degrees Fahrenheit is as follow F=(9/5C) +32 Celsius Fahrenheit 70 158 80 176 90...
Create a program (Python) YourFirstnameLastnameA06b.py to ask the user to create a password: The user will...
Create a program (Python) YourFirstnameLastnameA06b.py to ask the user to create a password: The user will first enter a password, then enters the same password again; If the second input is the same as first one, the user successfully creates the password. Print “Well done.”; Otherwise, the user will be directed to repeat the whole process (go to step 1.)
Posting together because they are related. Python 1. Create a program to count the number of...
Posting together because they are related. Python 1. Create a program to count the number of occurrences of each letter of the alphabet in a text file, and print out the total for each letter (if greater than 0). Ignore numbers, punctuation, and special characters. Make sure to treat capital and lowercase letters as occurrences of the same letter. The text file (sample_text.txt) is attached to the assignment. Example: For the text "My dog's name is Winston." The results would...
Create a python program that will: prompt a user for a command Command get_data Level 1:...
Create a python program that will: prompt a user for a command Command get_data Level 1: Take one of the commands my_max my_min my_range my_sum mean median mode fib factorize prime Requirements: Your commands should be case-insensitive You should use python lists to store data You should NOT use built-in python math functions, or math libraries to compute these values Tips: Write one function that will convert a string with comma-separated numbers into a python list with the numbers. You...
Create a Python program that: Allows the user to enter a phrase or sentence. The program...
Create a Python program that: Allows the user to enter a phrase or sentence. The program should then take the phrase or sentence entered Separate out the individual words entered Each individual word should then be added to a list After all of the words have been place in a list Sort the contents of the list Display the contents of the sorted list with each individual word displayed on a separate line Display a message to the user indicating...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT