Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Date 04/04/2020

1. Find Output

2. Find outputs

3. If else statement questions:

1. Find syntax error in 2. A school has following rules for grading


the following program system:
code: a. Below 25 - F
i=20 b. 25 to 45 - E
if I in 20: c. 45 to 50 - D
print(true , end=#): d. 50 to 60 - C
else: e. 60 to 80 - B
print(false)
f. Above 80 - A
Ask user to enter marks and print the
corresponding grade.
4. Find ouput :

x = ['hello', 'students']
for i in x:
    x.append(i.upper())
print(x)

5. What is the output of the following program?


i =1
while True:
    if i%3 == 0:
        break
    print(i)
    i + = 1

6. What will be the output of the following Python code?


i = 5
while True:
if i%0O11 == 0: # 011 is an octal convert it into decimal then find o/p
break
print(i)
i += 1

7. Convert question no. 5 and 6 into for loop.


8. Write program using for loop to:
1. Display the following pattern , no. of rows and columns will be entered by user:
22222
44444
66666
88888
9. Write program to display sum of following series:
(1) 1+ ( 1+2 ) + ( 1+2+3 ) + ( 1+2+3+ 4 ) +… … … … …
(2) 1- x2/2! + x4/4! -x6/6!+---------------------------------------------

You might also like