Computers and Technology

How would i do this in python? Create a program called Lab3B1 that will do the following
• Ask the user to enter an unknown set of integers, and stop when they enter 9999
• Add up all the even numbers.
• After the loop, print the sum of the even numbers with a label.


This is what I have so far:

data = input("Enter a number or enter 9999 to stop: ")
total=0
while data != "":
number=int(data)
total+= number
data=input("Enter a number or enter 9999 to stop: ")

if data == '9999':
break

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 13:00, Cookie320
Write a program which asks you to enter a name in the form of first middle initial last. so you might enter for example samuel p. clemens. use getline to read in the string because it contains spaces. also, apparently the shift key on your keyboard doesn’t work, because you enter it all lower case. pass the string to a function which uses .find to locate the letters which need to be upper case and use toupper to convert those characters to uppercase. the revised string should then be returned to main in the form last, first mi where it will be displayed.
Answers: 1
image
Computers and Technology, 23.06.2019 12:10, jefersina16
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, Heyitsbrandi
Now you’re on your own. include a short summary of this section with plots in your lab report. write a matlab script file to do steps (a) through (d) below. include a listing of the script file with your report. 1 the soundsc(xx, fs) function requires two arguments: the first one (xx) contains the vector of data to be played, the second argument (fs) is the sampling rate for playing the samples. in addition, soundsc(xx, fs) does automatic scaling and then calls sound(xx, fs) to actually play the signal. mcclellan, schafer, and yoder, dsp first, 2e, isbn 0-13-065562-7. prentice hall, upper saddle river, nj 07458. c 2015 pearson education, inc. 4 mcclellan, schafer and yoder, signal processing first. prentice hall, upper saddle river, new jersey, 2003. c 2003 prentice hall. (a) generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the 4000 hz sinusoids defined in the next part, part (b). use a definition for tt similar to part 2.2(d). if we use t to denote the period of the sinusoids, define the starting time of the vector tt to be equal to t , and the ending time as ct . then the two cycles will include t d 0. finally, make sure that you have at least 25 samples per period of the sinusoidal wave. in other words, when you use the colon operator to define the time vector, make the increment small enough to generate 25 samples per period. (b) generate two 4000 hz sinusoids with arbitrary amplitude and time-shift. x1.t / d a1 cos.2
Answers: 1
image
Computers and Technology, 24.06.2019 06:30, chloeholt123
For which utilities, if any, does the landlord pay?
Answers: 2
Do you know the correct answer?
How would i do this in python? Create a program called Lab3B1 that will do the following
• A...

Questions in other subjects:

Konu
Mathematics, 18.08.2021 01:00
Konu
Arts, 18.08.2021 01:00
Konu
Health, 18.08.2021 01:00