0% found this document useful (0 votes)
7 views2 pages

Python Practice Questions

The document contains a series of Python practice questions designed to enhance programming skills. Topics include factorial calculation, power functions, number guessing games, running averages, and list manipulations. The exercises also cover prime number identification, element separation, and frequency analysis within lists.

Uploaded by

prakash singh
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)
7 views2 pages

Python Practice Questions

The document contains a series of Python practice questions designed to enhance programming skills. Topics include factorial calculation, power functions, number guessing games, running averages, and list manipulations. The exercises also cover prime number identification, element separation, and frequency analysis within lists.

Uploaded by

prakash singh
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/ 2

*Python practice questions taught in class*

Q1. write a program to find factorial of given num

Q2. Write a program x power y

Q3. Write a program to find largest and second largest integer from set of 10 integers without
using data type.

Q4.Write a Python program for a number guessing game where the computer randomly selects a
number between 1 and 10. The user has only 3 chances to guess the correct number. If guessed
correctly, display a success message

Q5.Suppose user keep entering positive integer one by one, repeating write a program to
compute running average of the number so far. If the running fall below 10, the program should
exit.

Q6.Write a program that take positive number as input and do the following. If the number of
digits are even, then print number of digits. If number of digits are odd, then nothing should be
printed, and program should move to next iteration. If the number is negative, terminate the loop
and print number of iterations performed in program.

Q7.Write a program to do the following, read integer x


determine number of digits in X
form a number y with number of digits in x at 10th place and MSB of x at the one’s digits

*##Nested Loops*
Q8. Write a program to find all prime numbers from 2 to 100.

*##LIST*
Q.9 Write a program in Python to print all even element in a list .

Q10. Write a program to print all even position elements in a list.

Q11. Write a program to separate integer elements of a list into two separate lists, one containing
all prime numbers and another list containing all non-prime numbers.

Q12. Find second minimum number and its position


Q13. Extract two lists out of given list of number 1 to 20. List 1 contains every other element of
list between 5 to 15. Second list contains every fourth element of the list. Find sum and average
of these two lists And find the intersection elements of these two lists

Q14. Write a program to find the frequency of all elements in a list. Also, prepare a list of unique
elements and other lists containing duplicates.

Q15. Write a Python program that takes a list of numbers and rearranges it so that all zeros are
moved to the right while keeping the relative order of non-zero numbers unchanged

You might also like