Question

Write a python nested for loop that prints out the following pattern 100 99 98 97...

Write a python nested for loop that prints out the following pattern

100

99 98

97 96 95

94 93 92 91

90 89 88 87 86

85 84 83 82 81 80

79 78 77 76 75 74 73

72 71 70 69 68 67 66 65

64 63 62 61 60 59 58 57 56

55 54 53 52 51 50 49 48 47 46

45 44 43 42 41 40 39 38 37 36 35

34 33 32 31 30 29 28 27 26 25 24 23

22 21 20 19 18 17 16 15 14 13 12 11 10

2, Write a python nested for loop that prints out the following pattern

* # * # * # * # * # * # * # * # * # * #

* # * # * # * # * # * # * # * # * #

* # * # * # * # * # * # * # * #

* # * # * # * # * # * # * #

* # * # * # * # * # * #

* # * # * # * # * #

* # * # * # * #

* # * # * #

* # * #

​​​​​​​* #

3. write a python program that calculates the total of the following serious of 100 numbers

+ 1/5 + 2/7 + 3/9 + 4/9 + . . .

4. what is the total sum of the numbers from question 3

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer:

Explanation:

Here are the codes for all the programs mentioned above alongwith the output attached for the run.

feel free to comment if you need any help!

1)

Code:


n = 100
for i in range(1, 14):
for j in range(i):
print(n, end=' ')
n = n-1

print()

n = 100 for i in range(1, 14): for j in range(i): print(n, end= ) n = n-1 printa

Output:

100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 5

2)

Code:

for i in range(10, 0, -1):
for j in range(i):
print('*#', end=' ')

print()

for i in range(10, 0, -1): for j in range(i): print(*#, end=) printol

Output:

Press ENTER to exit console. I ... Program finished with exit code 0 * # #¥#¥ 转子 其 十 共 半 #¥#¥#¥#¥ #¥#¥#¥#¥#¥ #¥#¥#¥#¥#¥#¥ ###

3)

Code:

num = 1
den = 5
sum = 0
for i in range(100):
n = num/den
sum = sum + n
num = num + 1
den = den + 2
  
print(sum)

num = 1 den 5 Sum = @ for i in range(100): n = num den sum = sum + n num= num + 1 den den + 2 = print(sum) |

Output:

47.058 6348 6691879 ...Program finished with exit code 0 Press ENTER to exit console. I

4) The total should be 47.05

It is shown above in the output.

PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!

PLEASE COMMENT IF YOU NEED ANY HELP!

Add a comment
Know the answer?
Add Answer to:
Write a python nested for loop that prints out the following pattern 100 99 98 97...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT