#PythonPoll
Explore tagged Tumblr posts
amigoways · 9 months ago
Text
Tumblr media
Which of the following statements is used to exit a loop prematurely in #Python?
a) break b) exit c) stop d) end
0 notes
amigoways · 1 year ago
Text
Tumblr media
What will the following Python code print?
my_list = [1, 2, 3, 4, 5] new_list = [x * 2 for x in my_list if x % 2 == 0] print(new_list)
A) [2, 4, 6, 8, 10] B) [4, 8] C) [ ] D) [1, 2, 3, 4, 5]
1 note · View note