In: Computer Science
One Problem/Question (Four Parts)
1 Sample run:
0
10
20
30
40
50
60
70
80
90
100
2 Sample run:
449
9
143
101
115
479
299
115
199
211
The Average of the numbers is: 212.0
3 & 4 Sample run:
say something: hello
you said : hello
say something: what's up?
you said : what's up?
say something: done
you said : done
Goodbye!
#1
num=0
while num<=100:
print(num)
num+=10
#2
import random
total=0
for i in range(10):
num=random.randint(0,500)
while num%2==0:
num=random.randint(0,500)
total+=num
print(num)
print('The Average of the numbers is:',total/10)
#3
while True:
say=input('say something: ')
print('You said:',say)
if say=='done':
break
print('Goodbye!')
#4
say=' '
while say!='done':
say=input('say something: ')
print('You said:',say)
print('Goodbye!')