Python - Functions
Quiz
•
Computers
•
University
•
Hard
Used 413+ 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:
print type(type(int))
type 'int'
type 'type'
Error
0
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code :
L = ['a','b','c','d']
print "".join(L)
Error
None
abcd
[‘a’,’b’,’c’,’d’]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following segment:
chr(ord('A'))
A
B
a
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following program:
y = 8
z = lambda x : x * y
print z(6)
48
14
64
None of the above
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is called when a function is defined inside a class?
Module
Class
Another Function
Method
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the use of id() function in python?
Id returns the identity of the object
Every object doesn’t have a unique id
All of the mentioned
None of the mentioned
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following program:
import re
sentence = 'horses are fast'
regex = re.compile('(?P<animal>\w+) (?P<verb>\w+) (?P<adjective>\w+)')
matched = re.search(regex, sentence)
print(matched.groupdict())
{‘animal’: ‘horses’, ‘verb’: ‘are’, ‘adjective’: ‘fast’}
(‘horses’, ‘are’, ‘fast’)
‘horses are fast’
‘are’
Create a free account and access millions of resources
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?
Similar Resources on Wayground
10 questions
Visual Basic 2010
Quiz
•
8th Grade - University
10 questions
CS100||MsWord
Quiz
•
University
11 questions
Types of Mass Media
Quiz
•
10th Grade - Professi...
14 questions
Binary Tree
Quiz
•
University
10 questions
Software dan Hardware
Quiz
•
University
10 questions
Peranti Input Ouput
Quiz
•
University
15 questions
Chapter 8 - Memory Management Strategies
Quiz
•
University
10 questions
Hands-on Modul 3
Quiz
•
University
Popular Resources on Wayground
10 questions
Honoring the Significance of Veterans Day
Interactive video
•
6th - 10th Grade
10 questions
Exploring Veterans Day: Facts and Celebrations for Kids
Interactive video
•
6th - 10th Grade
19 questions
Veterans Day
Quiz
•
5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
15 questions
Circuits, Light Energy, and Forces
Quiz
•
5th Grade
6 questions
FOREST Self-Discipline
Lesson
•
1st - 5th Grade
7 questions
Veteran's Day
Interactive video
•
3rd Grade
20 questions
Weekly Prefix check #2
Quiz
•
4th - 7th Grade
Discover more resources for Computers
7 questions
Different Types of Energy
Interactive video
•
4th Grade - University
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)
Quiz
•
8th Grade - University
7 questions
Force and Motion
Interactive video
•
4th Grade - University
25 questions
Waves-8th Grade Physical Science
Quiz
•
KG - University
41 questions
Unit 8 Key Terms
Quiz
•
11th Grade - University
10 questions
Product & Quotient Derivative Rules
Quiz
•
University
5 questions
How to Calculate Force - Newton's 2nd Law of Motion
Interactive video
•
10th Grade - University
10 questions
Dichotomous Key
Quiz
•
KG - University
