0% found this document useful (0 votes)
22 views1 page

Python For Loop Exercises and Solutions

The document outlines a Python for loop assignment consisting of 10 questions worth a total of 20 marks. Each question requires writing a Python program to perform various tasks such as printing numbers, calculating sums, generating multiplication tables, counting even and odd numbers, finding factorials, and more. The assignment is designed to test the understanding and application of for loops in Python programming.

Uploaded by

umaisalima62
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views1 page

Python For Loop Exercises and Solutions

The document outlines a Python for loop assignment consisting of 10 questions worth a total of 20 marks. Each question requires writing a Python program to perform various tasks such as printing numbers, calculating sums, generating multiplication tables, counting even and odd numbers, finding factorials, and more. The assignment is designed to test the understanding and application of for loops in Python programming.

Uploaded by

umaisalima62
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Python for Loop Assignment

Total marks:20
Question 1: Write a Python program to print all the numbers from 1 to 10 using a for loop.
Question 2: Write a Python program to find the sum of all numbers from 1 to 100 using a for
loop.
Question 3: Write a Python program to print the multiplication table of a given number using a
for loop.
Question 4: Write a Python program to count the number of even and odd numbers from a
series of numbers using a for loop.
Hint: Find even and odd from this list:
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Question 5: Write a Python program to find the factorial of a number using a for loop.
Question 6: Write a Python program to print the Fibonacci sequence up to a specified number
using a for loop.
Question 7: Write a Python program to check if a given number is prime or not using a for loop.
Question 8: Write a Python program to find the largest element in a list using a for loop.
Question 9: Write a Python program to reverse a given string using a for loop.
Question 10: Write a Python program to find the common elements between two lists using a
for loop.
List1 = [1,2,3]
List2 = [4,5,1]
# common element is 1

You might also like