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

Python Interview Quetions

The document outlines various fundamental concepts of Python programming, including basics, operators, strings, lists, tuples, sets, dictionaries, and functions. It covers key features, data types, control structures, and common operations, providing examples and programming tasks for practical understanding. The content serves as a comprehensive guide for beginners to learn and practice Python programming.

Uploaded by

photo9975
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)
2 views3 pages

Python Interview Quetions

The document outlines various fundamental concepts of Python programming, including basics, operators, strings, lists, tuples, sets, dictionaries, and functions. It covers key features, data types, control structures, and common operations, providing examples and programming tasks for practical understanding. The content serves as a comprehensive guide for beginners to learn and practice Python programming.

Uploaded by

photo9975
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/ 3

1.

Python Basics

1. What are the key features of Python?


2. How is Python interpreted?
3. What are variables in Python? How do you declare them?
4. What is the difference between Python 2 and Python 3?
5. What is the use of type() and id() functions in Python?
6. Explain dynamic typing with an example.
7. How do you take user input in Python?
8. What are Python keywords? List any 5.
9. What is the difference between is and == operators?
10. What are the rules for naming variables in Python?
11. Difference between Dynamic and Static typing
12. What is type casting?
13. Which is the by default data type in python?
14. Is python a scripting language?
15. Difference between % and / and // operator
16. Why python in interpreted language.
17. Which languages are used to design python?
18. Create arithmetic calculator using python
19. Explain sep and end with example
20. How many data types available inside a python? Explain any 5
21. What is difference between identifier and variable?
22. What is difference between compiler and interpreter?
23. What is static and dynamic typing
24. Convert temperature from farhenhite to celcious

2. Operators, if...else, Loops

1. Explain the difference between =, ==, and != operators.


2. Explain membership operators with example.
3. How many bitwise operators available inside a python? Explain any 2
4. What is the output of 5 // 2 and 5 % 2?
5. Write a program to check whether a number is even or odd.
6. What is the difference between if, elif, and else?
7. Write a Python program to find the largest of three numbers.
8. Write a program to print the multiplication table of a number using a for loop.
9. Explain the difference between while and for loop.
10. What is the purpose of break, continue, and pass statements?
11. Write a program to check weather given person eligible for voting or not
12. Write a program to count the sum of digits in a number using a loop.
13. Use nested loops to print the following pattern:

**

***

****
14. Design the following pattern:

23

456

15. Wap to find out sum of all the even numbers between 1….50
16. Design the following pattern

44

666

8888

17. Write a program to check weather entered number is Armstrong or not


18. Write a program to check weather entered number is perfect or not

3. Python Strings

1. What is a string in Python? How do you create one?


2. How are strings indexed in Python?
3. What is string slicing? Give examples.
4. Write a program to reverse a string.
5. What are common string methods like upper(), lower(), find(), replace(), and strip()?
6. What is the difference between isalpha(), isdigit(), and isalnum()?
7. Write a program to count the number of vowels in a string.
8. How can you check if a string is a palindrome?
9. What does join() and split() do in Python?
10. Explain string formatting using f-strings, .format(), and %.

4. Lists

1. How do you create a list in Python?


2. How can you access and modify elements in a list?
3. What are the differences between append(), extend(), and insert()?
4. Write a program to remove duplicates from a list.
5. How do slicing and indexing work in lists?
6. What is the difference between pop(), remove(), and del?
7. How can you sort a list in ascending and descending order?
8. Write a program to find the largest and smallest number in a list.
9. How can you use list comprehension? Give an example.
10. How do you merge two lists?

5. Tuple, Set, Dictionary

Tuple
1. What is a tuple? How is it different from a list?
2. How do you access elements of a tuple?
3. Can a tuple contain mutable elements? Explain.
4. How can you convert a list to a tuple and vice versa?
5. Can we edit tuple? If yes then how?

Set

1. What is a set in Python?


2. Write a program to remove duplicate values using a set.
3. What are set operations like union, intersection, and difference?
4. Can a set contain duplicate elements? Explain.
5. Dictionary
6. What is a dictionary in Python? How is it different from a list?
7. How do you add, delete, or update elements in a dictionary?
8. Write a program to count the frequency of each word in a string using a dictionary.
9. How can you iterate through keys and values in a dictionary?
10. What is the purpose of get() and setdefault() methods?

6. Functions

1. How do you define a function in Python?


2. What is the difference between return and print()?
3. Explain the difference between positional, keyword, and default arguments.
4. Write a program with a function to calculate factorial of a number.
5. What is recursion? Write a recursive function for Fibonacci numbers.
6. What is the difference between local and global variables?
7. Explain the use of *args and **kwargs with examples.
8. How do lambda functions work? Give an example.
9. What is the purpose of map(), filter(), and reduce()?
10. What are docstrings and how are they used?
11. What is recursion? Explain with example

You might also like