Advertisements
Advertisements
Question
Write a program to display all 3 digit odd numbers.
Solution
Odd Number (3 digits)
for a in range (100, 1000)
if a % 2 = = 1:
print b
Output:
101, 103, 105, 107, .. …… 997, 999
APPEARS IN
RELATED QUESTIONS
The condition in the if statement should be in the form of ______
Which is the most comfortable loop?
What is the output of the following snippet?
i=1
while True:
if i%3 ==0:
break
print(i,end='')
i +=1
Which punctuation should be used in the blank?
if<condition>_
statement-block 1
else:
statement-block 2
List the control structures in Python.
Write a note on the break statement.
Write is the syntax of if..else statement?
Write a note on if..else structure.
Using if..else..Elif statement writes a suitable program to display the largest of 3 numbers.
Write a detailed note on if..else..elif statement with suitable example.