The document contains questions about Python programming concepts like loops, conditional statements, functions, and patterns. It asks the reader to:
1. Find syntax errors and outputs of code snippets using if/else statements, loops, functions etc.
2. Write programs to display patterns, calculate grades based on marks, find sums of numeric series, and convert loop examples between while and for loops.
The document contains questions about Python programming concepts like loops, conditional statements, functions, and patterns. It asks the reader to:
1. Find syntax errors and outputs of code snippets using if/else statements, loops, functions etc.
2. Write programs to display patterns, calculate grades based on marks, find sums of numeric series, and convert loop examples between while and for loops.
The document contains questions about Python programming concepts like loops, conditional statements, functions, and patterns. It asks the reader to:
1. Find syntax errors and outputs of code snippets using if/else statements, loops, functions etc.
2. Write programs to display patterns, calculate grades based on marks, find sums of numeric series, and convert loop examples between while and for loops.
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!+---------------------------------------------