1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
il63 [147K]
3 years ago
10

Given a variable temps that refers to a list, all of whose elements refer to values of type float, representing temperature data

, compute the average temperature and assign it to a variable named avg_temp. Besides temps and avg_temp, you may use two other variables -- k and total.temps = []
avg_temp = 0.0
total = 0.0

for k in range(temps):
total += k

avg_temp = total/len(temps)

Computers and Technology
2 answers:
Anna35 [415]3 years ago
7 0

Answer:

temps = [10.2, 20.4, 30.0]

avg_temp = 0.0

total = 0.0

for k in temps:

   total += k

avg_temp = total/len(temps)

print(avg_temp)

Explanation:

- Create a list temps, that holds value for temperatures

- Initialize the average and total

- Initialize a for loop that iterates through the temps

- Add the values in temp to the total

- When the loop is done, calculate the average

- Print the average

suter [353]3 years ago
5 0

Answer:

temps = [23.4, 20.2, 19.5, 21.3, 18.7, 25.4, 24.9]

avg_temp = 0.0

total = 0.0

for k in temps:

 total += k

print("The total is \n", total)  

avg_temp = total/len(temps)

print("The average temperature is \n", avg_temp)

Explanation:

Using Python programming language

Create a list with seven values for daily temperature values (Its hard-coded to represent seven days of the week)

Declare and initialize to zero the variables avg_temp and total

Use a for loop to add elements of the list

Print the values

see attached code and output

You might be interested in
Write an expression that continues to bid until the user enters 'n'. Sample output with inputs: 'y' 'y' 'n' I'll bid $7! Continu
Likurg_2 [28]

Answer:

#include <iostream>

#include <cstdlib>  

using namespace std;

int main() {

  char Keep_Going = '-';

  int nextBid = 0;

  srand(5);

  while (Keep_Going != 'n') { //<-- solution

     nextBid = nextBid + (rand()%10 + 1);

     cout << "I'll bid $" << nextBid << "!" << endl;

     cout << "Continue bidding? ";

     cin >> Keep_Going;

  }

  cout << endl;

  return 0;

}

4 0
3 years ago
What is meant by slide rule?​
OleMash [197]

Answer:

a manual device used for calculation that consists in its simple form of a ruler and a movable middle piece which are graduated with similar logarithmic scales.

Explanation:

^

5 0
2 years ago
Write a program palindrome.py that prompts for a sequence of words or numbers on a single line and checks if the entries are pal
olya-2409 [2.1K]

Answer:

Explanation:

The program first asks the user for the sequence of words. Then it splits the sequence into an array of words. Then it loops through the array checking each word to see if it is a palindrome. If it is it prints the word, the boolean value, and adds 1 to the palindrome_count variable. Otherwise it prints the word, false, and moves on to the next word in the list. Finally, it prints out the total value of palindrome_count.

word = input("Enter sequence of words: ")

word_list = word.split(' ')

print(word_list)

palindrome_count = 0

for word in word_list:

   print('\n\n')

   reverse = word[::-1]

   if word == reverse:

       print(word, end='\n')

       print(True, end="\n")

       palindrome_count += 1

   else:

       print(word, end='\n')

       print(False, end='\n')

print("\n\nNumber of Palindromes in Sequence: " + str(palindrome_count))

3 0
3 years ago
Which method is used to edit a function that has been created and inserted into a cell?
8_murik_8 [283]

Answer:

A

Explanation:

A

4 0
3 years ago
Read 2 more answers
. What are the differences between a centralized and distributed database architecture
Digiron [165]

Answer:

The difference between the centralized and the distributed database architecture are as follows:

  • The centralized database is the type of database which works on the single file in the database. Whereas, the distributed database works with the multiple files in the database.  
  • The centralized database refers to the proper planning and the helps in the decision making in the management system. Whereas, in the distributed database system the data are mainly distributed in the multiple files and the user can easily access the near by file in the database system.
  • In the centralized database, if the database are get fail then the overall system come to halt. On the other hand in the distributed system, if the component get failed then the performance of the system are get reduced.

6 0
3 years ago
Other questions:
  • What connects two or more LANs together?
    10·2 answers
  • A student is helping a friend with a home computer that can no longer access the Internet. Upon investigation, the student disco
    9·1 answer
  • Which network is the predecessor of the Internet?
    13·1 answer
  • Universal Containers has a requirement to integrate Salesforce with an external system to control record access.
    12·1 answer
  • Use the _______ command to combine the selected cells and center them. merge across center across selection merge cells merge an
    7·1 answer
  • ¿Cuál es la potencia de una lámpara de incandescencia que se conecta a la red de 220 V, sabiendo que tiene una resistencia de 50
    8·1 answer
  • I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
    13·1 answer
  • Some applications required advanced storage solutions are available to provide fault tolerance and high performance.
    13·1 answer
  • Which components are involved with input? Output? Processing? Storage?
    15·2 answers
  • HELP ME ILL GIVE BRAINLY Input 50 numbers and then output the average of the negative numbers only. Write in pseudocode!
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!