Question
python
Write a Python program to construct the following pattern, using a nested for loop. * * * * * * * * * * * * * * * * * * * * *
1 0
Add a comment Improve this question Transcribed image text
✔ Recommended Answer
Answer #1

Answer:

here is the program you need:

for i in range(10): if i<=4: for j in range(i+1): print(*, end=) else: for j in range(10 - i-1): print(*, end=) print


for i in range(10):
if i<=4:
for j in range(i+1):
print('*', end='')
else:
for j in range(10 - i-1):
print('*', end='')
print()

Output:

phpBV7nby.png

Hope you like it!
PLease provide comments if you have any doubts!

Add a comment
Know the answer?
Add Answer to:
python Write a Python program to construct the following pattern, using a nested for loop. *...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

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
Active Questions
ADVERTISEMENT