0% found this document useful (0 votes)
12 views3 pages

Exam Mock Test (Level-1)

Uploaded by

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

Exam Mock Test (Level-1)

Uploaded by

sarawinisy
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Level-1 Python Test

String Manipulation Questions

Uppercase Conversion

1. Question: Write a Python program that asks the user to enter their name and then prints
their name in uppercase letters.

name=input("Enter user name")

print(name.upper())

Lowercase Conversion

2. Question: Write a Python program that asks the user to enter their city and then prints the
name of the city in lowercase letters.
name=input("Enter user name")
print(name.lower())

String Length

3. Question: Write a Python program that asks the user to enter their favorite color and then
prints the length of the color's name.
favorite_color=input("Enter your favorite color")
print("Length of the color's name",len(favorite_color))

Uppercase First Letter

4. Question: Write a Python program that asks the user to enter their favorite animal and then
prints the animal's name with the first letter capitalized.
favorite_animal=input("Enter your favorite animal")
print("The first letter capitalized:",favorite_animal.capitalize())

Check Uppercase

5. Question: Write a Python program that asks the user to enter a word and then checks if the
word is in uppercase. Print a message indicating whether the word is in uppercase or not.
word=input("Enter a word:")
if word.isupper():
print("Word is an uppercase!")
else:
print("It is not uppercase!")
Check Lowercase

6. Question: Write a Python program that asks the user to enter a word and then checks if the
word is in lowercase. Print a message indicating whether the word is in lowercase or not.
word=input("Enter a word:")
if word.islower():
print("Word is a lowercase!")
else:
print("It is not lowercase!")
Arithmetic Questions

Addition

7. Question: Write a Python program that asks the user to enter two numbers and then prints
the sum of those numbers.

Subtraction

8. Question: Write a Python program that asks the user to enter two numbers and then prints
the difference between those numbers.

Multiplication

9. Question: Write a Python program that asks the user to enter two numbers and then prints
the product of those numbers.

Division

10. Question: Write a Python program that asks the user to enter two numbers and then prints
the quotient of the division of those numbers. If the second number is zero, print a message
saying "Cannot divide by zero."
num1=int(input("Enter number1:"))
num2=int(input("Enter number2:"))
if num2==0:
print("Cannot divide by zero.")
result=num1/num2
print("The division result is",result)

Modulus

11. Question: Write a Python program that asks the user to enter two numbers and then prints
the remainder when the first number is divided by the second number.
num1=int(input("Enter number1:"))
num2=int(input("Enter number2:"))
result=num1%num2
print("The remainder is:", result)

Square

12. Question: Write a Python program that asks the user to enter a number and then prints the
square of that number.
num1=int(input("Enter number1:"))
print("The square value is", num1**2)

Sum of Three Numbers

13. Question: Write a Python program that asks the user to enter three numbers and then prints
the sum of those numbers.

num1=int(input("Enter number1:"))
num2=int(input("Enter number2:"))
num3=int(input("Enter number1:"))
result=num1+num2+num3
print("The sum value is", result)
Average of Two Numbers

14. Question: Write a Python program that asks the user to enter two numbers and then prints
the average of those numbers.
num1=int(input("Enter number1:"))
num2=int(input("Enter number2:"))
total=num1+num2
average=total/2
print("The result is", average)

Double a Number

15. Question: Write a Python program that asks the user to enter a number and then prints
double that number.
num1=int(input("Enter number1:"))
print("The double value is",num1*2)

You might also like