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
postnew [5]
2 years ago
13

Write a program that inputs numbers and keeps a running sum. When the sum is greater than 100, output the sum as well as the cou

nt of how many numbers were entered.
Sample Run Enter a number: 1 Enter a number: 41 Enter a number: 36 Enter a number: 25 Sum: 103 Numbers Entered: 4
Computers and Technology
1 answer:
lyudmila [28]2 years ago
5 0

total = 0

count = 0

while total<=100:

   total += int(input("Enter a number: "))

   count += 1

print("Sum:",total)

print("Numbers Entered:",count)

I wrote my code in python 3.8. I hope this helps

You might be interested in
WILL GIVE BRAINLIEST TO HELPFUL ANSWERS!
sashaice [31]

Algorithm is part of computer science. You an learn it on Khan academy. (you probably werent looking for this but no one was answering)

7 0
2 years ago
Only about 10 percent of the world’s population uses the internet.
lora16 [44]
False there are soooo many more people
Because look on our own Brainly there are more than 1,000 people
MARK ME BRAINLEST
4 0
2 years ago
I don't know what to do, anyone there?​
s2008m [1.1K]
I’m here, hello. . . . . . .
3 0
2 years ago
What would be the results of the following code? int[] x = { 55, 33, 88, 22, 99, 11, 44, 66, 77 }; int a = 10; if(x[2] &gt; x[5]
Nezavi [6.7K]

Answer:

The answer is "Option A".

Explanation:

In the given code an integer array "x" is defined, that stores some elements and another integer variable "a" is declared, that holds a value that is "10". In this code a conditional statement is defined, which checks array element value, in if block element of array that position is 2 is greater then the element of array that position is 5.if this condition is true, so variable a value is change that is equal to 5. In else block if the above condition is not true so the value of a variable is equal to 8, and another options is wrong that can be described as follows:

  • In option B, The given condition is not false, that's why it is not correct.
  • In option C, The value of variable a is changed when condition is true or false, that's why it is not correct.
  • In option D, It is wrong because we can compare array elements.

6 0
3 years ago
Write a Python program that takes a file name as input and generates the following output: File size in bytes and KBs Time the f
Airida [17]

Answer:

See explaination

Explanation:

import os

import time

from stat import *

file = input("Enter file name: ")

details = os.stat(file)#stores statistics about a file in a directory

print("File size: ", details[ST_SIZE])#retreiving size

print("File last accessed time: ", time.asctime(time.localtime(details[ST_ATIME])))#access time

print("File last modified time: ", time.asctime(time.localtime(details[ST_MTIME])))#modified time

print("File creation time: ", time.asctime(time.localtime(details[ST_CTIME])))#creation time

print("First character: ", file[0])

print("Middle character: ", file[len(file) // 2])

print("Last character: ", file[len(file) - 1])

num_words = 0

num_lines = 0

f=open(file, "r")

lines = f.readlines()

for line in lines:

num_lines = num_lines + 1

num_words = num_words + len(line.split())#add no. of words in that line

print("Number of lines: ", num_lines)

print("Number of words: ", num_words)

8 0
2 years ago
Other questions:
  • You use a ____ following the closing brace of an array initialization list.
    12·2 answers
  • Footnotes and endnotes can be used to explain information in more detail, add opinions or comments, or to cite sources in the do
    7·1 answer
  • Which items may interfere with a wireless connection and may cause disruptions or delays in submitting assignments in blackboard
    9·2 answers
  • Difference between volatile and non volatile memory
    14·2 answers
  • Dam naj za pierwszej osobie która odpowie dobrze!
    13·1 answer
  • Ssume the following variables contain the values shown: numberRed = 100 numberBlue = 200 numberGreen = 300 wordRed = "Wagon" wor
    5·1 answer
  • There are 55 registers, and total 60 instructions available in a general-purpose computer. The computer allows only 2-address in
    6·1 answer
  • What is the disadvantage of a mesh topology?
    12·2 answers
  • In the event you get pulled over for a traffic stop, describe the situation from the police officer's perspective and list at le
    6·2 answers
  • Answer the questions about PowerPoint using the drop-down menus,
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!