Question

In Python what is the output? Instead of using newlines to separate, use comma to separate...

In Python what is the output? Instead of using newlines to separate, use comma to separate each line ie. (a,b,c,...)

for i in range(10, 1, -1):

print(i, end=",")

0 0
Add a comment Improve this question Transcribed image text
Answer #1
Output is
10,9,8,7,6,5,4,3,2, 

Explanation

  • range(10, 1, -1) gives numbers from 9 through 2 because when 1 comes, it stops and each time decrements by 1 since the third parameter is -1
  • print(i, end=",") means to print i and at the end a comma must be there. So, after each and every number there is a comma
Add a comment
Know the answer?
Add Answer to:
In Python what is the output? Instead of using newlines to separate, use comma to separate...
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