Ex 2401
Ex 2401
(i) (ii)
# 1
## 23
### 456
#### 7 8 9 10
##### 11 12 13 14 15
Solution
(i) (ii)
Note: Including end="" as the final parameter prevents it from moving down to the next line after
displaying the value.
4. Write two programs (one using for loop and the other using while loop)
that prints odd numbers between 1 - 10.
The output for both the programs should look like this 1 3 5 7 9 finished
i = 0
while i < 11:
if i % 2 != 0:
print(i, end=' ')
i = i + 1
print()
print('finished')
5. Write Python program that accepts three (3) integers, and then find the
largest number among the three input numbers
7. Write a program that reads an integer from the user. Then your
program should display a message indicating whether the integer is
even or odd.