a=1
while a<11:
print(a)
a=a+1
The above is the program for displaying the numbers 1 to 10. Write it as a
program for displaying numbers from 10 to 20.
Answers
Answered by
1
Answer:
Else’ is used along with ‘if’ to define the alternative path if the condition mentioned in the ‘if’ statement is incorrect. This means that only one statement can be evaluated using if..else statement.
If more than one statements need to be evaluated, ‘elif’ construct is used. There is no limit on the number of ‘elif’ construct which should be used in a statement. However, the conditions mentioned in each ‘elif’ construct should be mutually exclusive i.e. if one of the conditions in if..elif is correct it should imply that all the other conditions are false.
Similar questions