0 like 0 dislike
540 views
sum=0
for x in range(6):
    sum=sum+x
    if(x==2):
        sum=sum+10 
        
        
print(sum)   

 

What will be the output of this code ? Also, I need the explanation too. 

 

 

 

 

 

 

in Beginners by | 540 views

1 Answer

0 like 0 dislike
the sum of answer is 25
by

Get best answers to any doubt/query/question related to programming , jobs, gate, internships and tech-companies. Feel free to ask a question and you will receive the best advice/suggestion related to anything you ask about software-engineering , development and programming problems .