Prutor Python Quiz 2 by anupmaurya June 13, 2021 written by anupmaurya June 13, 2021 318 Welcome to your Prutor Python Quiz 2 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 1 out of 10 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() 2 out of 10 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 3 out of 10 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 4 out of 10 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() 5 out of 10 6. What is used for performing a repetitive tasks in Python? a) Counters b) Lists c) Arrays d) Loops 6 out of 10 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 () 7 out of 10 8. 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) 8 out of 10 9. What should come in the blank if we want to print HI! 6 times? for i inrange( ): print(“HI!”) a) 1,5 b) 1,6 c) 5 d) 1,7 9 out of 10 10. Which of the following is a valid singleton tuple? a) single=(1) b) single=1, c) single=() d) single=1 10 out of 10 Time's upTime is Up! 0 comment 0 FacebookTwitterPinterestEmail anupmaurya "Hi there, My name is Anup Maurya. I have a passion for programming and previously worked at TCS, one of the best global IT services and consulting companies, as a System Administrator. I also enjoy graphic design. It's a pleasure to have you here." previous post Prutor Python Quiz 3 next post Prutor Python Quiz 9 Leave a Comment Cancel Reply Save my name, email, and website in this browser for the next time I comment.