python programming questions
Python Programming Python Tutorials

Python Programming Questions for Practice

Python Programming Questions for Practice

In this tutorial we have list down some important python programming questions for practice which are generally asked in technical interview and also in semester examination of different Universities.

If are a beginners to Python Programming language or you have Python Programming as a Subject in Your Semester then these questions may be helpful to you in securing good marks.

Python Programming Short Questions

Python Programming short questions are given below. These questions are generally asked in 2 marks in University Examination.

Q1. What is Python ?

Q2. Write different Features of Python.

Q3. Why is Python an interpreted Language ? 

Q4. What do you understand by immediate mode and script mode in python?

Q5.List the standard data types in python.

Q6.Discuss Number data type in Python with example.

Q7.What is String in Python?

Q8What is Set Data Type in Python ?

Q9.What is negative index in python? Explain with example

Q10.Discuss why Python is called as dynamic and strongly typed language?

Q11.Write a for loop that print number from 0 to 57 using range function.

Q12.Explain the use of break and continue statement in python with example

Q13.WAP to check input number is prime or not ?

Q14.WAP to check that input year is leap year or not

Q15.What will be the output of following code

I=0;

While i<3:

Print(i)i+=1

else:

print (0)

Python Programming Long Questions

Python Programming Long Questions are given below these questions are generally asked in 5 Marks or 7 marks in University exam.

Q1. Write short notes on Type Conversion in Python 

Q2.What do you mean by Python IDE. Explain in detail .

Q3.Discuss the concept of List Slicing in Python.

Q4.Define floor division operator in Python with example.

Q5.Discuss different Built in function used in python for String.

Q6.WAP to print the following Pattern

*

* *

* * *

* * * *

* * * * *

Q7. In some languages, every statement ends with a semi-colon (;). What happens if you put a semi-colon at the end of a Python statement?

Q8.Explain all the Conditional Statements in Python using small code example.

Q9.Explain Expression Evaluation & Float Representation with example. Write a Python Program for How to check if a given number is Fibonacci number.

Q10.Explain the purpose and working of loops. Discuss Break and continue with example. Write a Python program to convert time from 12 hour to 24-hour format.

Q11.Does Python use Switch Case statement ?  Discuss various alternatives of implementing switch case in python with example.

Q12.Write the difference between Python Array and List ?

Q13.Write a Python Function named ComputeAverage to find the average of list of numbers.

Q14. What will be the output of the following Python code? [AKTU 2021-22 III Sem]

def cube(x):

return x * x * x

x = cube(3)

print x

Q15. Write a Python program to change a given string to a new string where the first and last chars have been exchanged. [AKTU 2021-22 III Sem]

Q16.Write a Python program to add an item in a tuple.  [AKTU 2021-22 III Sem]

Q17.Differentiate Fruitful functions and void functions. [AKTU 20-21 III Sem]

Q18.Explain higher order function with respect to lambda expression. Write a Python code to Count occurrences of an element in a list. [AKTU 20-21 III Sem.

Q19.Explain Unpacking Sequences, Mutable Sequences, and List Comprehension with example ( Program ).

Q20.Write a program to sort list of dictionaries by values in Python – Using lambda function  [AKTU 20-21 III Sem]

Q21.What is function ? How do we define and call a function inn  python. Give an example ( Program )

Q22.Write the advantage of using function or why do we use function ?

Q23.List some Built in function in python with their use.

Q24.Write a function to perform the sum of two numbers.

Q25.Discuss Various types of arguments in Function in Python.

Q26.What is Scope of a variable ?

Q27.Explain LEGB Scope rules in python with example ( Program ).

Q28.What is String in Python ? how we can create a string ?

Q29.How can we access an individual character of a string and substring from a given string?

Q30.Print a given string 3 times using * operator

Q31.Explain string related built in functions with example ( Program )

Q32.What is Tuple in Python ? How to create a tuple.

Q33.Write the difference between and tuple and list.

Q34.How can we access the tuple’s elements ? given an example ( Program ).

Q35.Discuss the use of Slice operator [ ] and [ : ] in tuple.

Q36.Discuss negative indexing in tuple with an example ( Program ).

Q37.Discuss the various Tuple Functions with example ( Program ).

Q38.How can we create a tuple from List , string . Write an example ( Program ) for each.

Q39.Discuss unpacking sequences in Python with example ( Program ).

Q40.What is List in Python ? Ho can we create a List.

Q41.How can we access List elements in python ?

Q42.Discuss the use of Slice operator [ ] and [ : ] in context to list with example ( Program ).

Q43.Explain the use of Following functions related to list with program.

Q44.Explain List Comprehension with suitable example ( Program ).

Q45.Explain Mutable Sequences with example ( Program ).

Q46.What is Set ? How to create a SET in Python ?

Q47.Discuss various functions related to SET.

Q48.How can we create a set from a given list , string, tuple ? Give example ( Program )

Q49.What is dictionary in Python ? How to create dictionary in python ?

Q50.How to access data elements of dictionary ? Discuss with example ( Program )

Q51.How can be update the value of a Key in dictionary ? Give an example ( Program

Q52.How can we delete a data element of dictionary.

Q53.Discuss the functions methods in context to dictionary with an example.

Q54.Explain Lambda Expression with suitable example ( Program ).

Conclusion and Summary

I hope these python questions for practice will be beneficial for computer science students or for whom who are looking for job as software developer.

Good Luck !

Dont Stop Learning..!

 

Leave a Reply

Your email address will not be published. Required fields are marked *