0% found this document useful (0 votes)
6 views5 pages

Python Viva

Uploaded by

manumanoj80506
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)
6 views5 pages

Python Viva

Uploaded by

manumanoj80506
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

01. When and who developed python?

Ans:- Python was developed in 1980’s by Guido Van Rossum.

02. What is a python?

Ans:- Python is a high-level, general-purpose programming language.

03. What are identifiers?

Ans:- Identifiers are names used to identify variables, functions, or other objects in Python.

04. What is a datatype?

Ans:- A datatype defines the type of a value, such as integer, float, string, or boolean.

05. What is a function?


Ans:- A function is a reusable block of code that performs a specific task, takes inputs, and may
return a value.

06. Why is python interpreted language?

Ans:- Python is an interpreted language because its code is executed line by line by the Python
interpreter, rather than being compiled into machine code first.

07. What is indentation? Why is it required?

Ans:- Indentation refers to the spaces at the beginning of a line of code, and it is required in Python
to define code blocks, like loops and functions.

08. What are Iterators in Python?

Iterators are collections of items, and they can be a list, tuples, or a dictionary.

09. What is Polymorphism in Python?

Ans:- Polymorphism allows objects of different classes to be treated as objects of a common


superclass, typically through method overriding.

10. What is encapsulation in Python?

Ans:- Encapsulation is the concept of bundling data and methods that operate on that data within
a class, restricting direct access to some of the class’s components.

11. What is abstraction in Python?

Ans:- Abstraction is the process of hiding the complex details and showing only the essential features
of an object or method.

12. Define Lambda function?

A lambda function is a small anonymous function. A lambda function can takes anyno of arguments
but can have only one expression.

13. What is comments?


Ans:- A comment is a line of text in the code that is ignored by the interpreter and is used to explain
the code for readability.
14. What is a string?

Ans:- A string is a data type used in programming, such as an integer and floating point unit, but is
used to represent text rather than numbers.

15. What is an even number?

Ans:- We will also find all even numbers in between a given range in Python.
Even number:- A number is called an even number if it is divisible by 2.

16. What is a while loop?

Ans:- a while loop is a control flow statement that allows code to be executed repeatedly.

17. What is a set...?

Ans:- Set is a collection which is unordered, unchangeable*, and unindexed. No duplicate members.

18. What is a union?

Ans:- Python Set union() The union() method returns a new set with distinct elements from all the
sets. The union of two or more sets is the set of all distinct elements present in all the sets.

19. What is a difference?

Ans:- The difference between the two sets in Python is equal to the difference between the number
of elements in two sets.

20. What is a intersection?

Ans:-Python set intersection When intersecting two or more sets, you'll get a new set consisting of
elements that exist in all sets

21. What is a tuple?

Ans:- Tuple is a collection which is ordered and unchangeable. Allows duplicate members.

22. What is a list?

Ans:- List is a collection which is ordered and changeable. Allows duplicate members.

23. What is a variable?

Ans:-A python variable is a reserved memory location to store data values

24. What is an operator ?

Ans:-python operators in general used to perform operations on values and variables.

25. What is if statement?

Ans:-if statement is the simplest decision-making statement.

26. What is token?

Ans:-the smallest individual unit in program is called token.

27. What is a keyword ?


Ans:-the words which are represent the syntax and structure of the python language are called
keyword.

28. What is a dictionary?

Ans:- Dictionary is a collection which is ordered, and changeable. No duplicate members.

29. What are modules?

Ans:- A Python module is a file containing Python definitions and statements. A module can define
functions, classes, and variables. A module can also include runnable code.

30. What is a package?

Ans:- Python package can contains several module. In simpler terms a package is folder that contains
various modules as files.

31. What is a numpy?

Ans:- NumPy is a Python library.

NumPy is used for working with arrays.

NumPy is short for "Numerical Python".

32. What is a pandas?

Ans:- Pandas is an open source Python package that is most widely used for data science/data
analysis and machine learning tasks.

33. What is a errors in python?

Ans:-Error are the problems in a program due to which the program will stop the execution.

34. What is syntax error?

Ans:-The error which occur due to invalid syntax in the program are called syntax error.

35. What are the two formatted output string?

Ans:-1.using f function 2.using format function

36. What is array in python..?

Ans:- An array is a collection of items stored at contiguous memory locations. The idea is to store
multiple items of the same type together.

37. What are the types in loop control statement?

Ans:- 1.for loop 2. While loop 3. Do while loop

38. What are the types in flow control statement?

Ans:-1.if statement

2.if-else statement

3.elif statement

4.nested if statements
39. List 5 features of python.

Ans:-1.-Easy to use and learn

2. Expressive language

3.Interpreted language

4.Object-oriented language

5.Open source language

40. What are the different data types?

Ans:- Python supports data types like int, float, str, list, tuple, dict, set, and bool.

41. What are the different data types?

Ans:- Python supports data types like int, float, str, list, tuple, dict, set, and bool.

42. What is the break statement?

Ans:- break terminates the current loop and exits it.

43. How do you open a file?

Ans:- You can use the open() function to open a file in different modes like 'r', 'w', 'a'.

44. What is method overriding?

Ans:- Method overriding occurs when a subclass defines a method that overrides a method in its
superclass.

45. What is method overloading ?

Ans:- Python does not support method overloading directly. However, method overloading can be
achieved by default arguments or variable-length arguments.

46. What is a slice ?

Ans:- A slice is a method to extract a portion of a sequence like a string or list using start:end
notation.

47. What is command line?

Ans:- A command line in Python refers to the interface where users can interact with Python
programs by typing commands or running scripts in the terminal or command prompt.

48. what is membership operator?

Ans:- membership operators (in and not in) are used to check if a value is present in a sequence (like
a list, tuple, string, or dictionary)

49. What is constructor?

Ans:- A constructor in Python is a special method, __init__(), that is automatically called when an
object of a class is created. It initializes the object's attributes with default or specified values.

50. What is file ?


Ans:- a file is an object that provides a way to store and retrieve data on disk.

51. What are the types of file ?

Ans:- files are primarily of two types: 1. Text files 2. Binary files

52. What is data visualization ?

Ans:- Data visualization in Python is the process of creating graphical representations of data.

53. What are access modifier?

Ans:- Access modifiers define the visibility and accessibility of class attributes and methods. They
include public , protected and private.

You might also like