In: Computer Science
(Python)
Write a program which accomplishes the following tasks:
TURN IN
result1 = 3*4+(5.6/2.3)-.4
result2 = 'a'+2*'b'
result3 = 'a'+2*'b'+int(3.5)*'c'
######################
a=1.3
b=4
iterations=7
for i in range(iterations):
a=a*b
#######################
iterations=7
while iterations>0:
iterations-=1
########################
iterations=8
a=1.3
b=4
while iterations>0:
if iterations%2==0:
b-=.5
print('a:',a,'b:',b)
else:
a*=b
print('a:',a,'b:',b)
iterations-=1