Sign In
Ask Question
Kristin Tucker
Computers & Technology
28 March, 20:29
Edhesive 6.5 code practice question 4
+1
Answers (
2
)
Eden Key
28 March, 20:35
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
Emery George
28 March, 20:49
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
Know the Answer?
Answer
Not Sure About the Answer?
Find an answer to your question 👍
“Edhesive 6.5 code practice question 4 ...”
in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers
You Might be Interested in
In the Dread Pirate Roberts case, U. S. Ulbricht, 31 F. Supp. 3D 54D (S. D. N. Y. 2014), one of the issues that the court addressed was whether bitcoin is currency for purposes of the money laundering statutes.
Answers (1)
Should i buy the Samsung s10 + or wait for s11 or any other phones you guys suggest?
Answers (2)
Write a program that reads a list of integers, and outputs those integers in reverse. The input begins with an integer indicating the number of integers that follow.
Answers (1)
Create a JavaFX application that generates a 10 x 10 grid. Populate each cell in the grid with a random integer in the range [0, 99]. If the integer is divisible by 2, color the cell blue. If the integer is divisible by 3, color the cell yellow.
Answers (1)
Write a method that returns the sum of all the elements of an array of ints that have an odd index.
Answers (1)
New Questions in Computers & Technology
At the Data Link Layer of the OSI Model, what type of address is used to identify the receiving host?
Answers (1)
List three of the federal and state laws that have been enacted to protect the privacy of electronic data.
Answers (1)
A relationship between two classes using an open triangle describes: A) Association B) Inheritance C) Composition D) None of these
Answers (1)
Given a series of numbers as input, add them up until the input is 10 and print the total. Do not add the final 10.
Answers (1)
The is a federal law that provides a definition of the term cyberterrorism and under which young people primarily involved in what they consider to be minor computer pranks have been tried as cyberterrorists.
Answers (1)
Home
»
Computers & Technology
» Edhesive 6.5 code practice question 4
Sign In
Sign Up
Forgot Password?