0% found this document useful (0 votes)
23 views

Viva Q Python

The document contains a comprehensive list of practical questions for a Python lab viva, organized into ten practical sessions. Each session includes various questions covering key Python concepts such as data types, operators, functions, and programming constructs. The questions aim to assess the understanding and application of Python programming skills.
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)
23 views

Viva Q Python

The document contains a comprehensive list of practical questions for a Python lab viva, organized into ten practical sessions. Each session includes various questions covering key Python concepts such as data types, operators, functions, and programming constructs. The questions aim to assess the understanding and application of Python programming skills.
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/ 4

ARYA Institute of Engineering Technology and Management

Python Lab Viva Questions


Practical No. 1

Q.1. what are the key features of Python?

Q.2. Differentiate between lists and tuples.

Q.3. Explain the ternary operator in Python.

Q.4. What are negative indices?

Q.5. Is Python case-sensitive?

Q.6. How long can an identifier be in Python?

Q.7. How would you convert a string into lowercase ?

Q.8. What is the pass statement in Python?

Practical No. 2

Q.1. Explain help() and dir() functions in Python.

Q.2. How do you get a list of all the keys in a dictionary?

Q.3. What is slicing?

Q.4. How would you declare a comment in Python?

Q.5. How will you check if all characters in a string are alphanumeric?

Q.6. How will you capitalize the first letter of a string?

Q.7. We know Python is all the rage these days. But to be truly accepting of a great
technology, you must know its pitfalls as well. Would you like to talk about this?
Q.8. With Python, how do you find out which directory you are currently in?

Practical No. 3

Q.1. How do you insert an object at a given index in Python?

Q.2. And how do you reverse a list?


Q.3. And how do you reverse a list?

Q.4. What is the Python interpreter prompt?


Q.5. How does a function return values?
Q.6. How would you define a block in Python?
Q.7. Why do we need break and continue in Python?
Q.8. Will the do-while loop work if you don’t end it with a semicolon?
Q.9. In one line, show us how you’ll get the max alphabetical character from a string.

Practical No 4.

Q.1. What is Python good for?


Q.2. Can you name ten built-in functions in Python and explain each in brief?
Q.3. What will the following code output?
Q.4. How will you convert a list into a string?
Q.5. How will you remove a duplicate element from a list?
Q.6. Can you explain the life cycle of a thread?.
Q.7. What is a dictionary in Python?
Q.8. Explain the //, %, and ** operators in Python.

Practical No. 5

Q.1. What do you know about relational operators in Python.


Q.2. What are assignment operators in Python?
Q.3. Explain logical operators in Python.
Q.4. What are membership operators?
Q.5. Explain identity operators in Python.
Q.6. Finally, tell us about bitwise operators in Python.
Q.7. What data types does Python support?
Q.8. What is a docstring?

Practical No. 6

Q.1. How would you convert a string into an int in Python?


Q.2. How do you take input in Python?
Q.3. What is a function?
Q.4. What is recursion?
Q.5. What does the function zip() do?
Q.6. How do you calculate the length of a string?
Q.7. Explain Python List Comprehension.
Q.8. How do you get all values from a Python dictionary?
Practical No. 7

Q.1. What if you want to toggle case for a Python string?


Q.2. Write code to print only upto the letter t.
Q.3. Write code to print everything in the string except the spaces.
Q.4. Now, print this string five times in a row.
Q.5. What is the purpose of bytes() in Python?
Q.6. What is a control flow statement?
Q.7. Create a new list to convert the following list of number strings to a list of numbers.
nums=[‘22’,’68’,’110’,’89’,’31’,’12’]
Q.8. Given the first and last names of all employees in your firm, what data type will
you use to store it?

Practical No. 8

Q.1. How would you work with numbers other than those in the decimal number
system?
Q.2. What does the following code output?
Q.3. How many arguments can the range() function take?
Q.4. What is PEP 8?
Q.5. How is Python different from Java
Q.6. What is the best code you can write to swap two numbers?
Q.7. How can you declare multiple assignments in one statement?
Q.8. If you are ever stuck in an infinite loop, how will you break out of it?

Practical No. 9

Q.1. How do we execute Python?


Q.2. Explain Python’s parameter-passing mechanism.
Q.3. What is the with statement in Python?
Q.4. How is a .pyc file different from a .py file?
Q.5. What makes Python object-oriented?
Q.6. How many types of objects does Python support?

Practical No. 10

Q.1.Why is it called Python?


Q.2.What is the interpreter in Python?
Q.3.What does a python do?
Q.4.What is the purpose of PYTHONHOME environment variable?
Q.5.What is the purpose of PYTHONCASEOK environment variable?
Q.6.What is the purpose of PYTHONSTARTUP environment variable?
Q.7.What is the purpose of PYTHONPATH environment variable?
Q.8.If given the first and last names of bunch of employees how would you store it and
what datatype?

You might also like