Python Programming Test
Python Programming Test
Duration: 60 Minutes
Total Questions: 4
Total Marks: 40
Task:
4. If the user is younger than 18, print: "You are not eligible to vote."
Sample Output:
Hello, Sara!
Task:
2. Uses a for loop to calculate the sum of all even numbers from 1 to n.
Page 1
Python Programming Test
Topics: Input, Output, For Loops, If Conditions
Sample Output:
Task:
2. Uses a for loop to print a right-angled triangle pattern with n rows made of stars (*).
3. Each row should contain that many stars as the row number.
**
***
****
*****
Task:
You are asked to write a Python program for a school to generate a simple student report. The
program should:
1. Ask the user how many students' data they want to enter.
Page 2
Python Programming Test
Topics: Input, Output, For Loops, If Conditions
- Print whether the student has Passed (marks >= 50) or Failed (marks < 50).
3. After all entries, print the total number of students who passed and failed.
Sample Output:
Total Passed: 2
Total Failed: 1
Page 3