KEMBAR78
Class10 Python Worksheet | PDF
0% found this document useful (0 votes)
3 views2 pages

Class10 Python Worksheet

This document is a Python worksheet for Class 10 students containing 10 simple programs to practice basic programming concepts. The exercises include finding the greatest of two numbers, checking even or odd, printing multiplication tables, and more. Students are encouraged to type, execute, and modify the programs for better understanding.

Uploaded by

nireljoshua5177
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)
3 views2 pages

Class10 Python Worksheet

This document is a Python worksheet for Class 10 students containing 10 simple programs to practice basic programming concepts. The exercises include finding the greatest of two numbers, checking even or odd, printing multiplication tables, and more. Students are encouraged to type, execute, and modify the programs for better understanding.

Uploaded by

nireljoshua5177
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
You are on page 1/ 2

Python Worksheet – Class 10

This worksheet contains 10 simple Python programs based on the Class 10 Computer
Applications curriculum.
Students should practice typing and executing each program, observe the output, and try
modifying them for better understanding.

1. Find the Greatest of Two Numbers


a = int(input("Enter first number: "))
b = int(input("Enter second number: "))

if a > b:
print("Greatest number is:", a)
else:
print("Greatest number is:", b)

2. Check Whether Number is Even or Odd


num = int(input("Enter a number: "))

if num % 2 == 0:
print(num, "is Even")
else:
print(num, "is Odd")

3. Check if Number is Positive, Negative, or Zero


n = int(input("Enter a number: "))

if n > 0:
print("Positive")
elif n < 0:
print("Negative")
else:
print("Zero")

4. Print Multiplication Table


n = int(input("Enter a number: "))

for i in range(1, 11):


print(n, "x", i, "=", n * i)

5. Sum of First N Natural Numbers


n = int(input("Enter a number: "))
sum = 0

for i in range(1, n + 1):


sum += i
print("Sum of first", n, "natural numbers is:", sum)

6. Check if a String is a Palindrome


s = input("Enter a string: ")

if s == s[::-1]:
print("Palindrome")
else:
print("Not a palindrome")

7. Count Vowels in a String


s = input("Enter a string: ")
vowels = "aeiouAEIOU"
count = 0

for ch in s:
if ch in vowels:
count += 1

print("Number of vowels:", count)

8. Find Largest Element in a List


numbers = [10, 25, 4, 78, 56]
print("List:", numbers)
print("Largest number:", max(numbers))

9. Display Fibonacci Series up to N Terms


n = int(input("Enter number of terms: "))
a, b = 0, 1

print("Fibonacci Series:")
for i in range(n):
print(a, end=" ")
a, b = b, a + b

10. Find Factorial of a Number (Using Function)


def factorial(n):
fact = 1
for i in range(1, n + 1):
fact *= i
return fact

num = int(input("Enter a number: "))


print("Factorial of", num, "is:", factorial(num))

You might also like