Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(Python 3.8)- #Q6. Write a program to print sum of first 10 Natural numbers. Why does this code print 10 lines? x = 10 summation

(Python 3.8)- #Q6. Write a program to print sum of first 10 Natural numbers. 
 Why does this code print 10 lines? x = 10 summation = 0 while x >= 1: summation = summation + x x = x-1 print(summation)
While this one only prints the final answer? x = 10 summation = 0 while x >= 1: summation = summation + x x = x-1 print(summation)

What does the indentation do here?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Seven Databases In Seven Weeks A Guide To Modern Databases And The NoSQL Movement

Authors: Eric Redmond ,Jim Wilson

1st Edition

1934356921, 978-1934356920

More Books

Students also viewed these Databases questions

Question

Which are non projected Teaching aids in advance learning system?

Answered: 1 week ago

Question

What is the environment we are trying to create?

Answered: 1 week ago

Question

How can we visually describe our goals?

Answered: 1 week ago