Disclaimer for ReGyan
If you require any more information or you have any problem regarding Copyright or have any questions about our site’s disclaimer, please feel free to contact us by email at hello@regyan.com.
Disclaimers for ReGyan
All the information on this website is published in good faith and for general information and educational purpose only. ReGyan does not make any warranties about the completeness, reliability, and accuracy of this information. Any action you take upon the information you find on this website (regyan.com), is strictly at your own risk. will not be liable for any losses and/or damages in connection with the use of our website.
In this students get weekly assignments that they have to complete every week. Here we will show you or give you all the answers for the python quiz, These answers are for all those who have confusion in the questions or they don’t want to submit wrong answers.
or if you haven’t, then its a good time to check the answers first and then submit.
Python Programming 1st Week Quiz Solution
[1] What is the first step in write a program?
- (a): Run Code
- (b): Write Code
- (c): Edit Code
- (d): Check the Code
Answer:(b) Write Code
[2] Logical solution is a ____and clear _____procedure to solve the problem, known as _____.
- (a): problem description, step-by-step, flowchart
- (b): expression, assignment statement, identifier
- (c): finite, step-by-step, Algorithm
- (d): finite, assignment statement, algorithm
Answer: (c) finite, step-by-step, Algorithm
[3] Python is a/an___________ language (unlike C, C++, Java).
- (a): Logical programming
- (b): Interpreted programming
- (c): Compiled programming
- (d): Complex programming
Answer:(b) Interpreted programming
[4] What is the extension of a python file?
- (a): .py
- (b): .pyt
- (c): .py
- (d): ptn
Answer: (c) .py
[5] Which statement is correct?
- (a): print(hello world)
- (b): print “hello world!”
- (c): printf(“hello world!”)
- (d): print(“hello world”)
Answer: (d) print(“hello world”)
[6] In Python variables can be thought of as ______.
- (a): labels
- (b): containers
- (c): boxes
- (d): tumblers’
Answer:(a) labels
[7] Which function is used to get a string in Title Cases (First letter of each word in capital)?
- (a): pint()
- (b): title()
- (c): strip()
- (d): lstrip()
Answer: (b) title()
[8] Which function is used to get rid of the blank spaces on the left?
- (a): strip()
- (b): left()
- (c): rstrip()
- (d): lstrip()
Answer: (d) lstrip()
Also See:- Some Tips to Release Anger in 5 days
[9]: A Python Program is a sequence of ___ and ___.
- (a): data and information
- (b): classes and objects
- (c): strings and arrays
- (d): definitions and commands
Answer: (d) definitions and commands
[10]: What will be the output of : type(3.5) ?
- (a): class double
- (b): class str
- (c): class int
- (d): class ‘float’
Answer:(d) class ‘float’
[11] What will be the output of : int(2.5) ?
- (a): 1
- (b): 3
- (c): 2
- (d): 2.5
Answer:(c) 2
Also See: Python Programming Quiz – 3rd Week Quiz Solution
[12] Any input that you take in Python is of ___ data type.
- (a): str
- (b): int
- (c): float
- (d): char
Answer:(a) str
[13] What is the output of the following : 4//5 ?
- (a): 1
- (b): .8
- (c): 0
- (d):8
Answer:(c) 0
[14] What will be the value stored in y? : x, y, z = 1, 2, 3
- (a): 1
- (b): 2
- (c): 3
- (d): None of these
Answer: (b) 2
[15] Which of the following is a valid identifier or variable?
- (a): well&1
- (b): well 1
- (c): well_1
- (d): @well
Answer: (c) well_1
Python Programming 2nd Week Quiz Solution
[1] If list=[‘red’ , ‘blue’ , ‘green’ , ‘yellow’] , what will be the output of : list.pop() print (list) ?
- (a): yellow
- (b): red’, ‘blue’, ‘green’
- (c): blue’, ‘green’, ‘yellow’
- (d): error
Answer:(d) error
[2] If you want to use an item after you remove from what, which function should you use?
- (a): del()
- (b): not possible
- (c): remove()
- (d): pop()
Answer: (d) pop()
[3] If list=[‘suzuki’, ‘subaru’, ‘honda’, ‘maruti’] , what will be the output of print(list[3]), after running the function : list.sort(reverse=True) ?
- (a): suzuki
- (b): subaru
- (c): honda
- (d): maruti
Answer(c) honda
[4] Which statement is correct?
- (a): sorted() method sorts the items in ascending order
- (b): sorted() method maintains the sorted order of the items in the list
- (c): Both A and B
- (d): Neither A nor B
Answer: (a) sorted() method sorts the items in ascending order
[5] Which method is used to arrange the items in a list in ascending order?
- (a): sort()
- (b): arrange()
- (c): sort(reverse=True)
- (d): ascend()
Answer: (a) sort()
[6] What is used for performing a repetitive tasks in Python?
- (a): Counters
- (b): Lists
- (c): Arrays
- (d): Loops
Answer: (d) loops
[7] How is a line, or a group of lines related to the rest of the program?
- (a): square brackets []
- (b): indentation
- (c): braces {}
- (d): parentheses ()
Answer: (b) indentation
[8] What will be the output of the following code? students = {‘abhay’, ‘ananya’, ‘raj’} for student in students: print (student)
- (a): abhay ananya raj
- (b): Error
- (c): ananya raj
- (d): abhay raj
Answer: (a) abhay ananya raj
[9] What is the output of the following code? for value in range (1,5): print(value)
- (a): Error
- (b): 1 2 3 4 5
- (c): 2 3 4 5
- (d): 1 2 3 4
Answer: (d) 1 2 3 4
[10] If numbers=[1, 2, 3, 4, 5] , then how to get the largest value of this list?
- (a): high(numbers)
- (b): max(numbers)
- (c): large(numbers)
- (d): sum(numbers)
Answer: (b) max(numbers)
[11] Which statement will give a correct result?
- (a): for a in range(1,10):
print(“HI!”)
- (b): for a in range(1,10):
print(“HI!”)
- (c): for a in range(1,10): print(“HI!”)
- (d): None of the above
Answer: (c) for a in range(1,10): print(“HI!”)
[12] What values will the following? for i in range(1,8): print(i)
- (a): 1, 2, 3, 4, 5, 6, 7
- (b): 1, 2, 3, 4, 5, 6, 7, 8
- (c): 1, 8
- (d): 2, 3, 4, 5, 6, 7, 8
Answer:(a) 1, 2, 3, 4, 5, 6, 7
[13] What should come in the blank if we want to print HI! 6 times? for i in range(_____): print(“HI!”)
- (a): 1,5
- (b): 1,6
- (c): 5
- (d): 1,7
Answer: (d) 1,7
SEE ALSO: Ncert Biology Class 11 free pdf Download
[14] Which of the following is a valid singleton tuple?
- (a): single=(1)
- (b): single=1,
- (c): single=()
- (d): single=1
Answer:(b) single=1,
[15] What will be the output of the following? names=’abhay’, ‘raj’, ‘mahesh’ first, second, third = names print(second)
- (a): abhay, raj, mahesh
- (b):abhay,
- (c): raj
- (d): mahesh
Answer(c) raj
Thats all for the 1st and 2nd week solution for Python Programming. if you have any quetions, please comment down below, we will try to answer with in first 24 hour. Hope you liked this content, We will come with another week’s quiz, Thanks for reading. Good Bye.
What will be the output of the following? a=[1,2,3,4,5,6] b=[q for q in a if q%2==0] print(b)
IndentationError
👌👌👌👌💖💓💖
A hand written note in python programming please !
Bro , What will bt the answer of this question
Q. A python module can be also used as a script
1.True
2.False
False