Python Programming Quiz – 6th
Week Quiz Solution 2020
Important Notes:-
Hello Dosto Please Subscribe Our Youtube channel Because Copyright Problem In this post ( python / css / Al / nptel ) So please i humble Request Subscribe Our channel or social Networks ( than we are all are connect To each and every person ) These are Our youtube channel My Youtube Channel .. only 321 subscribe in my youtube channel .( channel ko subscribe kar lo kyuki kabhi bhi website band ho sakti hai sar post 2019 se ho rhe hai or answer sare senior ke dwara batye hue hai ) . youtube channel ko jaldi se share karo tak jada subscribe ho jaye to copyright ka koi problem na ho .. thanks
.1. In python,
(a).indentation indicates a block of code.
(b). def keyword is used to indicate starting of a function.
(c). A function can call other functions.
(d).All of the Above
Answer;- (d).All of the Above.
Reason:- Python uses indentation to indicate a block of code. & The “def” keyword is a statement for defining a function in Python. You start a function with the def keyword, specify a name followed by a colon (:) sign. so all are include in python .
Q.2.Assume that the "min" function computes the minimum of two value and "max" function computes the maximum of two value Let x1, x2 be 2 distinct integers. what can you say about the following program (using Python 3.X version):
y1 = min(x1,x2)
y2 = max(y1,y2)
(a).if x1 is smaller than x2 , then y1 and y2 will be same
(b).if x1 is greater than x2 , then y1 will be equal to x2.
(c).if we further run y3=max(y1,y2),then y3 will always be equal to x1
(d).All of the above
Answer:- (c).if we further run y3=max(y1,y2),then y3 will always be equal to x1.
Reason:-the "min" function computes the minimum of two value and "max" function computes the maximum of two value Let x1, x2 be 2 distinct integers. than we can say if we further run y3=max(y1,y2),then y3 will always be equal to x1.
Q3.which of of the below statement /s is/ are true for global keyword in Python?.
(a).it is used to read Global variable inside a function.
(b).if we want to use value of global variable inside a function, we will have to use Global keyword
(c).A variable name inside a function can be same as variable name of global variable.
(d).All of the above.
Answer:- (b).if we want to use value of global variable inside a function, we will have to use Global keyword.
Reason:- Different variables in a python program have different scope. ... A variable declared outside a function is a global variable by default. We use a global keyword for a variable which is inside a function so that it can be modified. Without the global keyword, the variable inside a function is local by default.
Q.4.what will be the output of the following code:-
def keywoedExample(x=1,y=2,z=4):
sum=x+y
min=sum - z
print(min)
keywordExample(y=8,x=4,z=y)
(a).Error
(b).9
(c).0
(d).5
Answer:-(a).Error
Reason:- File "HelloWorld.py", line 2
sum = x+y ^ IndentationError: expected an indented block , so the answer is error
Q.5.Which of the following statement is false for string in Python:
(a).they represent sequence of characters
(b).strings are mutable
(c).backslash be used to escape quote
(d).All of the above
Answer:- (d).All of the above
Reason:-To create a string, put the sequence of characters inside either single quotes, double quotes, or triple quotes and then assign it to a variable. You can look into how variables work in Python in the Python variables tutorial. For example, you can assign a character 'a' to a variable single_quote_character .
9 Comments
Thank u bhai
ReplyDeletesorry for late uploaded
Deletebro aap ka
Deletechannel delete ho gaya ?
qn ke YouTube pa mill nahi raha
Last one is wrong.It should be strings are mutable.
ReplyDeletequiz 7 solution???
ReplyDeleteThis comment has been removed by the author.
DeleteBhai week 7 upload kr do kl last date h
ReplyDeletePython week 7 answers please upload
ReplyDeletethank you
ReplyDelete