CLASS XII CS VIVA
CLASS XII CS VIVA
REVIEW OF PYTHON
VIVA QUESTIONS
Python IDLE can be used in two modes: Interactive mode and Script mode.
Python shell is an interactive interpreter. Python editor allows us to work
in script mode i.e. we can create and edit python source file.
['False', 'None', 'True', 'and', 'as', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif',
'else', 'except', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda',
'nonlocal', 'not', 'or', 'pass', 'raise', 'return', 'try', 'while', 'with', 'yield']
NOTE: All these keywords are in small alphabets, except for False, None, True,
which are starting with capital alphabets.
1
Review of Python | Vineeta Garg
6. What is a variable?
Variables are like containers which are used to store the values for some input,
intermediate result of calculations or the final result of a mathematical operation
in computer memory.
2
Review of Python | Vineeta Garg
11. What is the difference between mutable and immutable data types?
12. What are the comments? Declare a single line comment and a multi-
line comment.
Comments are the line that compiler ignores to compile or execute. There are two
types of comments in Python
3
Review of Python | Vineeta Garg
• Single line comment: This type of comment deactivates only that line
where comment is applied. Single line comments are applied with the help of
“ #”. For e.g.
• Multi line Comment: This Type of comment deactivates group of lines when
applied. This type of comments is applied with the help of triple quoted
string.
'''This is a
multiline comment'''
or
"""This is a
multiline comment"""
SYNTAX ERROR: An error in the syntax of writing code that does not conform
to the syntax of the programming language is called a syntax error.
LOGICAL ERROR: It is an error in a program's source code that results in
incorrect or unexpected result. It is a type of runtime error that may simply
produce the wrong output or may cause a program to crash while running.
RUN TIME ERROR: A runtime error is an error that occurs during execution of
the program and causes abnormal termination of program.
4
Review of Python | Vineeta Garg
/ // %
Divides two operands Integer division Divides two operands
and gives quotient and gives remainder
10/5=2 5//2=2 10%5=0
10/3.0 = 3.3 5.0//2=2.0
10.0/3=3.3
10/3=3
* **
Multiplies two operands Exponentiation
10*5=50 2**4= 16
= ==
Assigns the value Checks if the value of left operand is
equal to the value of right operand, if
yes then condition becomes true.
x=50 15= = 15, true
16 = = 15, false
>>> str3=str2+str1
5
Review of Python | Vineeta Garg
>>> print(str3)
EraTech
6
Review of Python | Vineeta Garg
[121, 'KABIR',
'RAMESH', 890, OUTPUT OUTPUT
453.9]
[100, 200, 300, 400, [121, 'KABIR',
500, 'Raman', 100, 'RAMESH', 890,
'Ashwin'] 453.9,10]
24. What is the difference among del, remove or pop methods to delete
elements from a List?
>>> list1 =[100, 200, >>> list1=[100, 200, >>> list1=[100, 200,
90, 'Raman', 100, 'Raman', 100] 50, 400, 500,
'Ashwin'] >>> del list1[2] 'Raman', 100,
>>> print(list1) 'Ashwin']
>>> list1.pop(2)
>>> list1.remove(400)
OUTPUT >>> print(list1)
OUTPUT
90 [100, 200, 100] OUTPUT
7
Review of Python | Vineeta Garg
25. What are the major differences between key and value in a
dictionary?
key value
Keys are unique Values may not be unique
The keys must be of an immutable data The values of a dictionary can be of
any type
type such as strings, numbers, or
tuples.
26. Give the difference between upper() and isupper() functions of string.
The upper() function returns the copy of the string with all the letters in
uppercase. The isupper() function returns True if the string is in uppercase.
Example
>>> print(str3.upper())
ERATECH
8
Review of Python | Vineeta Garg
The else clause in looping statements is executed when the loop terminates.
BREAK CONTINUE
s=10; s=10;
for i in range (10, 20, 3): for i in range (10, 20, 3):
s+=i s+=i
if(i==16): if(i==16):
break continue
print(s); print(s);
print("end"); print("end");
OUTPUT: OUTPUT:
20 20
33 33
end 68
end
9
Functions | Vineeta Garg
FUNCTIONS
VIVA QUESTIONS
1. What is a function?
Function is a named group of related programming statements which perform
a specific task. Functions are used to break the large code into smaller
manageable modules which are easy to manage and debug.
2. Need of functions
Some of the major advantages of using functions in a program are:
3. Types of functions
Basically, we can divide functions into the following three types:
• Built-in Functions
• Python Modules
• User-defined Functions
The keyword global may be used to access a global variable inside a function if
a local variable exists inside the function by the same name.
x=10 global x
print("x=",x) x=10
func() print("x=",x)
print(x) func()
print(x)
Program 1 Program 2
x= 10 x= 10
9 10
This is because in Python, variables that are only referenced inside a function
are implicitly global. If a variable is assigned a value or its value is modified
anywhere within the function’s body, it’s assumed to be a local unless explicitly
declared as global.
When arguments are passed as positional arguments, the order in which the
arguments are sent or their position is very important.
When arguments are passed as keyword arguments, the name of the argument
is given along with the value. In this case the position of arguments does not
matter. They can be written in random order.
2
Functions | Vineeta Garg
3
File Handling | Vineeta Garg
FILE HANDLING
VIVA QUESTIONS
1. What is the difference between files and variables of other data
types(like list, dictionary etc.) in terms of data storage ?
Variables store data in RAM which remains in memory as long as the program
is running and gets erased the moment our program gets over. This happens
because RAM is volatile in nature.
Files store the data on secondary storage devices like hard disk. The data stored
on secondary storage devices is permanent in nature and does not get erased
when the program gets over. When input/output operations are performed on
files data gets transferred from secondary storage to RAM and vice versa.
1
File Handling | Vineeta Garg
'w' Open a file for writing. Creates a new file if it does not exist or
truncates the file if it exists.
'a' Open for appending at the end of the file without truncating it.
Creates a new file if it does not exist.
Using with ensures that all the resources allocated to file objects gets
deallocated automatically once we stop using the file.
The write() function write a single string at a time and writelines() methods can
be used to write a sequence of strings.
The readlines()method reads the entire content of the file in one go and
returns a list of lines of the entire file. This method returns an empty value
when an end of file (EOF) is reached.
2
File Handling | Vineeta Garg
• Unpickling is the process by which a byte stream is converted back into the
desired object.
The process of pickling and unpickling a Python data object is known as object
serialization.
10. Name the methods which are used to write and read into/form a
binary file.
The dump method of pickle module is used to write objects to binary file. The
load method of pickle module is used to read the object from the binary file.
11. Name two important functions of CSV module which are used for
reading and writing.
The two important functions of CSV module are:
csv.reader() returns a reader object which iterates over lines of a CSV file
returns a writer object that converts the user's data into a
csv.writer() delimited string. This string can later be used to write into CSV
files using the writerow() or the writerows() function.
3
Libraries | Vineeta Garg
PYTHON LIBRARIES
VIVA QUESTIONS
Module is a file which contains python functions, global variables etc. It is nothing
but .py file which has python executable code / statement.
1
Libraries | Vineeta Garg
On the other hand, Comments are mainly used to explain non-obvious portions of
the code and can be useful for comments on Fixing bugs and tasks that are needed
to be done.
Docstrings are represented with opening and closing quotes while comments start
with a # at the beginning.
The comments cannot be accessed with the help function while docstring can be
accessed with the help function.
import <module_name> - This import the entire module and all functions
inside that module can be used in our program.
2
Stacks | Vineeta Garg
STACKS
VIVA QUESTIONS
1. What is a stack? Give some real-life examples.
Stack is a data structure that provides temporary storage of data in such a way
that the element stored last will be retrieved first. This method is also called
LIFO – Last In First Out. In real life we can think of stack as a stack of
copies, stack of plates, stack of rotis etc.
List
1
MySQL | Vineeta Garg
MY SQL
VIVA QUESTIONS
2. What is RDBMS?
RDBMS: A DBMS used to manage Relational Databases is called an RDBMS
(Relational Data Base Management System). Some popular RDBMS software
available are: Oracle, MySQL, Sybase, Ingress.
4. What is a relation?
Relation/Table: A table refers to a two-dimensional representation of data
arranged in columns (also called fields or attributes) and rows (also called records
or tuples).
1
MySQL | Vineeta Garg
2
MySQL | Vineeta Garg
11. Give a command to insert a new column into a table? Alter table
14. Give a command to insert a new row into a table? Insert into
18.In SQL can MAX function be applied to date and char type date?
Yes
3
MySQL | Vineeta Garg
4
Connectivity | Vineeta Garg
MySQL-PYTHON CONNECTIVITY
VIVA QUESTIONS
2. What are the five major steps for connecting MySQL and Python?
There are five major steps for connecting MySQL and Python.
cursor1 = conn1.cursor()
Here, cursor1 is a cursor object created using connection object conn1 using
cursor() method.
1
Connectivity | Vineeta Garg
Here, cursor1 is a cursor object which uses execute method to run the SQL query.
The sql query is given in the form of a string. The output of the SQL query is stored
in the cursor object in the form of a result set.
2
VIVA QUESTIONS
Ans. Python is an open source, platform independent, high level and interpreted language.
Q2. Name two modes of Python.
Q6. Which symbols are used for single line comments and multiple line comments?
Ans. # symbol
Q7. What do you mean by variable?
Ans. id command is used to find the address of variable for example, to find the address of
variable ‘x’ code is
>>>id(x)
Q9. What do you mean by data type?
Ans. Data type refers to the type of value used for example integer, float string etc
Q10. Name five primitive data type in python.
Ans. Five primitive data types are : Numbers, String, List, Tuple and Dictionary
Ans. Complex
Q15. Write the output of the following:
>>> 4.7e7
>>> 3.9e2
Ans.
47000000
390
Ans.
1. True
2. True
Q17. Write the code to display all keywords in python.
Ans. Operators are special symbols which perform a special task on values or variables. Same
operator can behave differently on different data types.
Q22. What is the output of 2 % 5?
Ans. 2
Q23. What is the difference between ‘=’ and ‘==’ operator?
Ans. Division operator(/) return the quotient in decimal while Floor Division Operator(//)
returns quotient as integer.
for example:
>>> 5 / 2 returns 2.5
>>> 5 // 2 returns 2
Ans.
while True:
print("A")
Ans. break statement is used to forcefully terminate the loop even the condition is True.
Q28. Write the output of the following :
>>> x = 8
>>> x = 5
>>> print (x + x)
Ans. 10
Q29. Identify the invalid variable names from the following and specify the reason also.
a) m_n
b) unit_day
c) 24Apple
d) #sum
e) for
f) s name
Ans.
24apple : Variable can not start with number
#sum : Variables can not start from special character.
for : Keyword can not be used as variable
s name : Spaces are not allowed in variable names
Q30. What do you mean by binary and unary operators? Give one example of each.
Ans. Binary operators work on two or more operands like Division (+), Multiplication (*).
2/3
4*3
Unary operators work only on one operand like Subtraction (-)
-9
-7
Ans.
// : Name of Operator is Floor Division . It is used to find the integer part of the quotient
when one number is divided by other
% : Name is Modulus or Remainder Operator . It is used to find the remainder when one
number is divided by other
** : Name is Exponent. It is used to find the power of a number like 2**3 will give result 8.
Q32. What is the difference between eval() and int() function?
Ans. eval( ) function return error on passing integer argument while int( ) function does not
return error.
for example :
print(eval(12)) returns error
print(int(12)) returns 12
Q33. What is the difference between Lists and Tuples?
Ans.
Lists Tuples
Ans. L1.reverse( )
Q35. What is string in python?
Ans. Strings are contiguous series of characters enclosed in single or double quotes. Python
doesn’t have any separate data type for characters so they are represented as a single
character string.
Ans. It means accessing all the elements of the string one by one using index value.
Q37. What do you mean by Replicating String?
Ans. It refers to making multiple copies of same string.
Q38. What is String slicing?
Ans. Try and Except are used in Error/Exception handling in Python. Code is executed in the
Try block and Except block is used to accept and handle all errors.
Q40. What is append( ) function in reference to list?
Ans. append( ) function simply add an element at the end of the list.
Ans.
Ans. The values which are used in function call are called actual argument while the variables
used in function definition are called formal argument.
Q44. Name the four types of actual arguments in python.
Ans. Global variable can be accessed inside or outside the function while local variable can be
accessed only inside the function where it is declared.
Q48. What is Recursion?
Ans. math module for sqrt( ), statistics module for mean( ) and pickle module for load( ).
Q52. What is the difference between Text file and Binary File.
Ans.
Text File Binary File
These files can be read by human directly These files can not be read by humans directly.
Processing of file is slower than binary file Processing of file is faster than text file
Q53. Name the function which is used to open or close file in python.
Ans. open( ) function is used to open file while close( ) is used to close the file.
Q54. Name three modes of opening a file.
Ans. read( ) method will read all content from the file while read(n) method will read first n
characters from file.
Ans. readline() : This function will read one line at a time from the file
readlines() : This function is used to read all the lines from the file.
Q57. What does the readlines( ) method returns?
Ans. This method will return a list of strings, each separated by \n.
Q58. What is the difference between write( ) and writelines( ) method?
Ans. write(string) : This method takes a string as parameter and write the same string into our
file.
writelines() : This method is used for writing the sequence data type like list, tuple or string
into a file.
Q59. Expand FIFO.
Ans. First In First Out
Q60. Expand LIFO
24. How can you access the result set? By using loop we fetch each record
25. What is None type?
26. Difference between text and binary files
27. Different modes of opening a file? Explain different modes
28. Difference between r,r+,rb(same for a and w)
29. Csv files-full form?
30. Method to open a file?
31. Extension of text , binary ,csv files?
32. What is the default mode of a file opened with open function?
33. Difference between append and write?
34. Which library should we import to work with binary files?
35. Dump function and syntax?
36. Load function and syntax
37. What do you mean by object in dump method?
38. Advantage of Binary files over text files? Fixed length records, fatser , Well structures
39. Why do we put try and except when we work with binary file?(As we have no idea how many records
are there in the file , it might lead to run time error as and when records end. So we handle it in
except. To avoid runtime error which is generated when we reach end of file(for same purpose we
use with clause with csv files)
40. What is EOFerror?
41. How do you close the file?
42. What is csv reader? What does it return?
43. Csv writer?
44. Library files for csv?
45. Write row?
46. File pointer? A reference which stores the address within a file to specify where the next read/write
operation will be performed
47. Tell()?
State some advantages of Python
Is Python an interpretated language?
What are Keywords?
What are iteration statements
What are selection statements
What are identifiers?
Difference between List and tuples
Use of Dictionary.
Concept of Bubble sort, Insertion sort, Selection sort.- Dry run on a given sample.
What are functions? Why are the advantages of the functions?
What are inbuilt functions?
what is the use of import keyword?
Can you create your own libraries?
Use of random functions.
. What are the key features of Python?
What are python modules? Name some commonly used built-in modules in Python?
What are local variables and global variables in Python?
.What is type conversion in Python?
Is indentation required in python?
How does break, continue and pass work?
What does [::-1} do?
What are python iterators?
How do you write comments in python?
How to comment multiple lines in python?
What is pickling and unpickling?
What is the purpose of is, not and in operators?
How can the ternary operators be used in python?
What do you understand by mutable and immutable types in python
Difference between random() and randint()
What are nested loops?
What are the different types of files?
what do you mean by file object
What are the parameters of open function .
How many values can a function return
Which statement helps to return values from a function
What is the role of file mode,
What are the different file modes(Basically you will be asked difference b/w any two li w and
w+, a and w,)
Difference between read(),readline(),readlines()
Use of close function
Difference between write and writelines
Use of flush function
How do you remove EOL character from the line read from the file.
what is stdin,stdout,stderr
What are relative file paths?
What are dump and load methods
Explain the process of pickling and unpickling
Tell and seek method- random examples can be given and asked about.
Full form of CSV
What are the two types of object of csv
writer/writerows/writerow() methods
In how many modes can you open a file
DO ALL THE OTQs from the book for data structures , file handling.
LIST vs TUPLES
LIST TUPLES
Lists are mutable i.e they can be Tuples are immutable (tuples are lists which
edited. can’t be edited).
Lists are slower than tuples. Tuples are faster than list.
Syntax: list_1 = [10, ‘Chelsea’, 20] Syntax: tup_1 = (10, ‘Chelsea’ , 20)
Ans: PEP stands for Python Enhancement Proposal. It is a set of rules that
specify how to format Python code for maximum readability.
Ans: A namespace is a naming system used to make sure that names are unique to
avoid naming conflicts.
Q9. What are python modules? Name some commonly used built-in
modules in Python?
Ans: Python modules are files containing Python code. This code can either be
functions classes or variables. A Python module is a .py file containing executable
code.
• os
• sys
• math
• random
• data time
• JSON
Variables declared outside a function or in global space are called global variables.
These variables can be accessed by any function in the program.
Local Variables:
Any variable declared inside a function is known as a local variable. This variable is
present in the local space and not in the global space.
Example:
1 a=2
2 def add():
3 b=3
4 c=a+b
print(c)
5 add()
6
Output: 5
When you try to access the local variable outside the function add(), it will throw an
error.
Ans: Type conversion refers to the conversion of one data type iinto another.
list() – This function is used to convert any data type to a list type.
dict() – This function is used to convert a tuple of order (key,value) into a dictionary.
Ans: Indentation is necessary for Python. It specifies a block of code. All code within
loops, classes, functions, etc is specified within an indented block. It is usually done
using four space characters. If your code is not indented necessarily, it will not
execute accurately and will throw errors as well.
Ans: Arrays and lists, in Python, have the same way of storing data. But, arrays can
hold only a single data type elements whereas lists can hold any data type elements.
Example:
Ans: A function is a block of code which is executed only when it is called. To define
a Python function, the def keyword is used.
Example:
def Newfunc():
1 print("Hi, Welcome to
2 Edureka")
3 Newfunc(); #calling the
function
Output: Hi, Welcome to Edureka
Q17.What is __init__?
Ans: __init__ is a method or constructor in Python. This method is automatically
called to allocate memory when a new object/ instance of a class is created. All
classes have the __init__ method.
Ans: An anonymous function is known as a lambda function. This function can have
any number of parameters but, can have just one statement.
Example:
The self variable in the init method refers to the newly created object while in other
methods, it refers to the object whose method was called.
[::-1] reprints a reversed copy of ordered data structures such as an array or a list.
the original array or list remains unchanged.
Q22. How can you randomize the items of a list in place in Python?
Ans: Iterators are objects which can be traversed though or iterated upon.
Ans: Random module is the standard module that is used to generate a random
number. The method is defined as:
1 import random
2 random.random
The statement random.random() method return the floating point number that is in
the range of [0, 1). The function generates random float numbers. The methods that
are used with the random class are the bound methods of the hidden instances. The
instances of the Random can be done to show the multi-threading programs that
creates a different instance of individual threads. The other random generators that
are used in this are:
1. randrange(a, b): it chooses an integer and define the range in-between [a, b).
It returns the elements by selecting it randomly from the range that is
specified. It doesn’t build a range object.
2. uniform(a, b): it chooses a floating point number that is defined in the range of
[a,b).Iyt returns the floating point number
3. normalvariate(mean, sdev): it is used for the normal distribution where the mu
is a mean and the sdev is a sigma that is used for standard deviation.
4. The Random class that is used and instantiated creates independent multiple
random number generators.
Example:
Ans: Pickle module accepts any Python object and converts it into a string
representation and dumps it into a file by using dump function, this process is called
pickling. While the process of retrieving original Python objects from the stored string
representation is called unpickling.
Ans: In Python, the capitalize() method capitalizes the first letter of a string. If the
string already consists of a capital letter at the beginning, then, it returns the original
string.
Example:
1 stg='ABCD'
2 print(stg.lower())
Output: abcd
Ans: Multi-line comments appear in more than one line. All the lines to be
commented are to be prefixed by a #. You can also a very good shortcut method to
comment multiple lines. All you need to do is hold the ctrl key and left click in
every place wherever you want to include a # character and type a # just once. This
will comment all the lines where you introduced your cursor.
Ans: Docstrings are not actually comments, but, they are documentation strings.
These docstrings are within triple quotes. They are not assigned to any variable and
therefore, at times, serve the purpose of comments as well.
Example:
1
"""
2 Using docstring as a comment.
3 This code divides 2 numbers
4 """
5 x=8
y=4
6 z=x/y
7 print(z)
8
Output: 2.0
Q31. What is the purpose of is, not and in operators?
Ans: Operators are special functions. They take one or more values and produce a
corresponding result.
is: returns true when 2 operands are true (Example: “a” is ‘a’)
Ans: Help() and dir() both functions are accessible from the Python interpreter and
used for viewing a consolidated dump of built-in functions.
1. Help() function: The help() function is used to display the documentation string
and also facilitates you to see the help related to modules, keywords,
attributes, etc.
2. Dir() function: The dir() function is used to display the defined symbols.
Q33. Whenever Python exits, why isn’t all the memory de-allocated?
Ans:
1. Whenever Python exits, especially those Python modules which are having
circular references to other objects or the objects that are referenced from the
global namespaces are not always de-allocated or freed.
2. It is impossible to de-allocate those portions of memory that are reserved by
the C library.
3. On exit, because of having its own efficient clean up mechanism, Python
would try to de-allocate/destroy every other object.
The following example contains some keys. Country, Capital & PM. Their
corresponding values are India, Delhi and Modi respectively.
1 dict={'Country':'India','Capital':'Delhi','PM':'Modi'}
1 print dict[Country]
India
1 print dict[Capital]
Delhi
1 print dict[PM]
Modi
Q35. What does this mean: *args, **kwargs? And why would we use
it?
Ans: We use *args when we aren’t sure how many arguments are going to be
passed to a function, or if we want to pass a stored list or tuple of arguments to a
function. **kwargs is used when we don’t know how many keyword arguments will
be passed to a function, or it can be used to pass the values of a dictionary as
keyword arguments. The identifiers args and kwargs are a convention, you could
also use *bob and **billy but that would not be wise.
Example:
1 stg='ABCD'
2 len(stg)
Ans: To modify the strings, Python’s “re” module is providing 3 methods. They are:
Q38. What are negative indexes and why are they used?
Ans: The sequences in Python are indexed and it consists of the positive as well as
negative numbers. The numbers that are positive uses ‘0’ that is uses as first index
and ‘1’ as the second index and the process goes on like that.
The index for the negative number starts from ‘-1’ that represents the last index in
the sequence and ‘-2’ as the penultimate index and the sequence carries forward like
the positive number.
The negative index is used to remove any new-line spaces from the string and allow
the string to except the last character that is given as S[:-1]. The negative index is
also used to show the index to represent the string in correct order.
Q39. What are Python packages?
Ans: To delete a file in Python, you need to import the OS Module. After that, you
need to use the os.remove() function.
Example:
1 import os
2 os.remove("xyz.txt")
Q41. What are the built-in types of python?
• Integers
• Floating-point
• Complex numbers
• Strings
• Boolean
• Built-in functions
Ans:
Ans: Elements can be added to an array using the append(), extend() and
the insert (i,x) functions.
Example:
1 a=arr.array('d', [1.1 , 2.1 ,3.1] )
2 a.append(3.4)
3 print(a)
4 a.extend([4.5,6.3,6.8])
5 print(a)
a.insert(2,3.8)
6 print(a)
7
Output:
Ans: Array elements can be removed using pop() or remove() method. The
difference between these two functions is that the former returns the deleted value
whereas the latter does not.
Output:
4.6
3.1
Ans: Shallow copy is used when a new instance type gets created and it keeps the
values that are copied in the new instance. Shallow copy is used to copy the
reference pointers just like it copies the values. These references point to the original
objects and the changes made in any member of the class will also affect the original
copy of it. Shallow copy allows faster execution of the program and it depends on the
size of the data that is used.
Deep copy is used to store the values that are already copied. Deep copy doesn’t
copy the reference pointers to the objects. It makes the reference to an object and
the new object that is pointed by some other object gets stored. The changes made
in the original copy won’t affect any other copy that uses the object. Deep copy
makes execution of the program slower due to making certain copies for each object
that is been called.
Ans: The compiling and linking allows the new extensions to be compiled properly
without any error and the linking can be done only when it passes the compiled
procedure. If the dynamic loading is used then it depends on the style that is being
provided with the system. The python interpreter can be used to provide the dynamic
loading of the configuration setup files and will rebuild the interpreter.
1. Create a file with any name and in any language that is supported by the
compiler of your system. For example file.c or file.cpp
2. Place this file in the Modules/ directory of the distribution which is getting
used.
3. Add a line in the file Setup.local that is present in the Modules/ directory.
4. Run the file using spam file.o
5. After a successful run of this rebuild the interpreter by using the make
command on the top-level directory.
6. If the file is changed then run rebuildMakefile by using the command as ‘make
Makefile’.
Python libraries are a collection of Python packages. Some of the majorly used
python libraries are – Numpy, Pandas, Matplotlib, Scikit-learn and many more.
Example:
1 a="edureka python"
2 print(a.split())
Output: [‘edureka’, ‘python’]
Example:
a) /
b) //
c) %
d) None of the mentioned
Answer: b) //
When both of the operands are integer then python chops out the fraction part and
gives you the round off value, to get the accurate answer use floor division. For ex,
5/2 = 2.5 but both of the operands are integer so answer of this expression in python
is 2. To get the 2.5 as the answer, use floor division using //. So, 5//2 = 2.5
a) 31 characters
b) 63 characters
c) 79 characters
d) None of the above