TIU Quiz-9

Quiz
•
Computers
•
University
•
Medium
Rahul Mahato
Used 7+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
10
5
lambda x: x * 2
Error
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a correct implementation of list comprehension to create a list of squares of numbers from 1 to 5?
[x ** 2 for x in range(1, 6)]
{x ** 2 for x in range(1, 6)}
{x: x ** 2 for x in range(1, 6)}
[x ** 2 in range(1, 6)]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to sort a list of tuples based on the second element of each tuple in descending order?
sorted(tuples, key=lambda x: x[1], reverse=True)
sorted(tuples, key=lambda x: x[0], reverse=True)
sorted(tuples, key=lambda x: x[1], reverse=False)
sorted(tuples, key=lambda x: x[0], reverse=False)
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
2024 5 16
16 5 2024
5 16 2024
Compile Time Error
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you convert a datetime object into a formatted string representation of the date and time?
str(date_obj)
date_obj.strftime("%Y-%m-%d %H:%M:%S")
date_obj.format("%Y-%m-%d %H:%M:%S")
format(date_obj, "%Y-%m-%d %H:%M:%S")
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What does the map() function in Python do?
Applies a function to each element of an iterable
Creates a map object from an iterable
Merges two iterables into one
Sorts elements of an iterable
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code?
[25, 10, 8]
[25, 10, 8, 15]
[30, 10, 8]
Error
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
JAVA III

Quiz
•
University
12 questions
Wizualizacja

Quiz
•
University
15 questions
Quiz 5- OOAD (JAVA)

Quiz
•
University
10 questions
DEBUG THE CODE

Quiz
•
University
13 questions
Functional Programming

Quiz
•
University
12 questions
AWS Severless Quizzes

Quiz
•
University
10 questions
104-P-01: Delegates and lambdas

Quiz
•
University
10 questions
CH 3(2)-Database Design

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University