gs gs109 List Comprehension - Python List Comprehension - Quiz No.3

gs gs109 Python Quiz

Online Quizzes Preparation

This quiz belongs to book/course code gs gs109 Python of gs organization. We have 134 quizzes available related to the book/course Python. This quiz has a total of 10 multiple choice questions (MCQs) to prepare and belongs to topic List Comprehension. NVAEducation wants its users to help them learn in an easy way. For that purpose, you are free to prepare online MCQs and quizzes.

NVAEducation also facilitates users to contribute in online competitions with other students to make a challenging situation to learn in a creative way. You can create one to one, and group competition on an topic of a book/course code. Also on NVAEducation you can get certifications by passing the online quiz test.

Question 2: What will be the output of the following Python code?

[ord(ch) for ch in 'abc']
Question 4: Write a list comprehension for producing a list of numbers between 1 and 1000 that are divisible by 3.
Question 5: Write a list comprehension equivalent for the Python code shown below.

for i in range(1, 101): if int(i*0.5)==i*0.5: print(i)
Question 6: What is the list comprehension equivalent for: list(map(lambda x:x**-1, [1, 2, 3]))?
Question 7: Write a list comprehension to produce the list: [1, 2, 4, 8, 16……212].
Question 8: What is the list comprehension equivalent for?

{x : x is a whole number less than 20, x is even}    (including zero)
Question 9: What will be the output of the following Python list comprehension?

[j for i in range(2,8) for j in range(i*2, 50, i)]
Question 10: What will be the output of the following Python code?

l=["good", "oh!", "excellent!", "#450"] [n for n in l if n.isalpha() or n.isdigit()]


Online Quizzes of gs109 Python

Other LANG related online quizzes

Other categories of gs Online Quizzes

Other organizations

Theme Customizer

Gaussian Texture



Gradient Background