Sign In
Ask Question
Computers & Technology
Mclean
6 January, 22:14
Edhesive 6.5 code practice question 4
+5
Answers (
2
)
Brady Hampton
6 January, 22:28
0
This question is incomplete. The complete question is given below:
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
Answer:
# Program in Python
sum = 0.0
for i in range (0, 10):
t = float (input ("Enter the Temperature: "))
sum = sum + t
print ("Sum: {0:0.1f}". format (sum))
Explanation:
Initialize the sum variable to hold the sum of input temperatures. Iterate from 0 to 9, Get the input and compute the sum. Print the result by formatting the sum so that value is printed with precision to single decimal place.
Comment
Complaint
Link
Romeo Burke
6 January, 23:09
0
This requires summantion of numbers through s python program, and numbers are stored in a text file.
Explanation:
def sumnumbers ():
file1 = open ("numbers1. txt","w")
i=5
while i! = 0:
num=input ("Enter number")
file1. write (num)
file1. write ("/n")
i = i - 1
file1. close ()
file=open ("numbers1. txt", "r+")
number = 0
sum1 = 0
for number in file:
sum1 = sum1 + int (number)
print (sum1)
file1. close ()
sumnumbers ()
Comment
Complaint
Link
Know the Answer?
Answer
Not Sure About the Answer?
Get an answer to your question ✅
“Edhesive 6.5 code practice question 4 ...”
in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers
You Might be Interested in
What are an administrator's choices for managing file permissions on a drive formatted as fat32?
Answers (1)
How is the regulation of security and trustworthiness on the Internet likely to develop? Will the private sector improve trust online? Will governments have to step in more?
Answers (1)
Used to collect data to predict an El Niño
Answers (1)
A network consists of 10 computers, all running windows 7 professional. one computer acts as a file server and serves up data to other computers on the network. which networking model does the network use
Answers (1)
The OSI security architecture provides a systematic framework for defining security attacks, mechanisms, and services. True or False
Answers (1)
New Questions in Computers & Technology
What is the term used to connect a device to a network that has an ip address?
Answers (1)
Why are some constraints automatically applied by the software
Answers (1)
Janice has to create a presentation about nutrition. Which is a good guideline to follow when creating her presentation? A) Use sound effects sparingly. B) Use different animations. C) Use dramatic effects.
Answers (1)
Which statement is true about test anxiety? Extreme anxiety usually motivates students to do well on tests. Pre-test anxiety is abnormal. Pre-test anxiety can be overcome. Extreme anxiety causes students to feel calm and relaxed.
Answers (1)
Given the following program segment, what is the test condition? Write "Enter your response (Y/N) " Input Answer If Answer = = "No" Then Write "Try Again" Input Answer End If Write "Are you having fun yet? (Y/N) " Input Response a. Answer b.
Answers (1)
Home
»
Computers & Technology
» Edhesive 6.5 code practice question 4
Sign In
Sign Up
Forgot Password?