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

Basic Python Interview Questions 1-10

The document provides basic Python interview questions and their answers, covering topics such as the definition of Python, its key features, variables, data types, lists, tuples, dictionaries, functions, comparison operators, and loops. It highlights Python's simplicity and versatility, along with examples for clarity. This resource is useful for preparing for Python-related interviews.

Uploaded by

zdtyg
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)
2 views2 pages

Basic Python Interview Questions 1-10

The document provides basic Python interview questions and their answers, covering topics such as the definition of Python, its key features, variables, data types, lists, tuples, dictionaries, functions, comparison operators, and loops. It highlights Python's simplicity and versatility, along with examples for clarity. This resource is useful for preparing for Python-related interviews.

Uploaded by

zdtyg
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

Basic Python Interview Questions with Answers (1-10)

1. What is Python?

Python is a high-level, interpreted programming language. It's known for its simplicity, readability,

and versatility. Python is used for web development, automation, data analysis, machine learning,

and more.

2. What are Python's key features?

- Easy to read and write

- Interpreted language

- Dynamically typed

- Extensive libraries (like Pandas, NumPy, etc.)

- Supports OOP and functional programming

3. What is a variable in Python?

A variable is a container to store data. In Python, you don't need to declare a data type. Example:

x = 10

4. What are data types in Python?

Common data types are:

- int (integer)

- float (decimal)

- str (string)

- bool (True/False)

- list, tuple, dict, set

5. What is a list in Python?

A list is an ordered, changeable collection. It can hold mixed data types.

Example:

my_list = [1, 'apple', 3.5]

6. What is the difference between a list and a tuple?


- List: mutable (can change), written with []

- Tuple: immutable (cannot change), written with ()

7. What is a dictionary in Python?

A dictionary stores key-value pairs. It's unordered and mutable.

Example:

my_dict = {'name': 'Manoj', 'age': 22}

8. What is a function in Python?

A function is a reusable block of code that performs a specific task.

Example:

def greet():

print('Hello')

9. What is the difference between '==' and 'is'?

'==' compares values. 'is' compares identities (memory locations).

Example:

'a' == 'a' is True, but a is b may be False unless a and b refer to the same object.

10. What are loops in Python?

Loops repeat a block of code.

- for loop: iterate over a sequence

- while loop: run while a condition is True

You might also like