Correct Answer: def odds(): value = 1 while True: yield value value += 2
Explanation:
Note: This Question is unanswered, help us to find answer for this one
Python Skill Assessment
Your Skill Level: Poor
Retake Quizzes to improve it
More Python MCQ Questions
Which of these is a valid way to implement switch-case in Python?
In the Python interpreter, if the code 'L = [4, 5, 6]; Y = [L] * 2; L[1] = 0' is executed, what would be stored in Y?
Python's implementation for .NET is:
Assume s = ' Hello World ' Which would remove only trailing whitespace?
What is 3/2?
A lambda function in Python can take __________.
Otput of the following Python code? num1 = 10 num2 = 14 num3 = 12 if (num1 >= num2) and (num1 >= num3): lg = num1+4 elif (num2 >= num1) and (num2 >= num3): lg = num2+5 else: lg = num3+3 print(lg*3)
Which two of the following shell expressions in Python 3.4.2 will give syntax error? 10 * (1/0); 2 + char *3; while True print('Python'); print('4') + print('4'); while False; print('Python'); What will be the output of the below-given code in Python 3.4.2 shell? >>>str = 'example123' >>>str[::-1]
While working in Python 3.4, sockets are by default created in the _______ mode.
Output of the following Python language code? from collections import OrderedDict od = OrderedDict() od['a'] = 1 od['b'] = 2 od['c'] = 3 od['d'] = 4 for key, value in od.items():