Write a program that displays the following table (note that 1 kilogram is 2.2 p
ID: 3565714 • Letter: W
Question
Write a program that displays the following table (note that 1 kilogram is 2.2 pounds): (Find numbers divisible by 5 and 6) Write a program that displays, ten numbers per line, all the numbers from 100 to 1,000 that are divisible by 5 and 6. The numbers are separated by exactly one space. (Find the smallest n such that n2 > 12,000) Use a whi 1 e loop to find the smallest integer n such that n2 is greater than 12,000. (Display four patterns using loops) Use nested loops that display the following patterns in four separate programs: (Sum a series) Write a program to sum the following series: (Turtle: draw circles) Write a program that draws 10 circles with centers (0,0), as shown in Figure 5.3b.Explanation / Answer
5.3)
def kilo_to_pound(w):
return 2.2*w;
5.12)
def divisibles():
t = 0
for i in range(100,1000):
if (i % 5 == 0 and i % 6 == 0):
print i,' ',
t += 1
if (t == 10):
print ''
t = 0
5.14)
def smallest():
i = 1
while (i*i < 12000):
i += 1
return i
5.26)
def sum_series():
i = 1
sum = 0
while (i < 99):
t = float(float(i)/float(i+2))
s += t
i = i+2
return sum
5.20)
def patternA():
j = 6
k = 0
while (j > 0):
k += 1
for i in range(0,k):
print (i+1),' ',
print ''
j -= 1
def patternB():
j = 6
k = 7
while (j > 0):
k -= 1
for i in range(0,k):
print (i+1),' ',
print ''
j -= 1
def patternC():
j = 6
m = 0
while (j > 0):
s = ''
k = 6
m += 1
for i in range(k):
if (k <= m):
s += str(k)+' '
else:
s += ' '
k -= 1
print s
j -= 1
def patternD():
j = 6
k = 7
while (j > 0):
k -= 1
for i in range(0,k):
print (i+1),' ',
print ''
j -= 1
for draw circle there is not image bro
anyway way for draw a circle
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.