CSE225 Basic Python Exercise Problems

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

CSE225

Exercises using Python

1. Write a program to generate a random number.


2. Write a program to check whether a number entered by you is positive,
negative or zero.
3. Write a program to check whether a number entered by you is even or odd.
4. Write a program to check whether a number entered by you is a prime number
or not.
5. Write a program to find the factorial of a number.
6. Write a program to convert a decimal number into binary, octal and
hexadecimal.
7. Write a program to find the factors of a number.
8. Create a list of numbers and write a program to find the numbers that are
divisible by a number entered by you.
9. Create a list of numbers and write a program to find the average of the list.
10.Create a list of numbers and write a program to check if all the numbers in the
list are greater than a number entered by you. If greater then print Yes if not
print No.

You might also like