How is a method different from a regular function?

120-140

Quiz
•
Information Technology (IT)
•
University
•
Hard
Ілияс Тілепалды
FREE Resource
20 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Method is inside a class
Method takes self as first parameter
Methods run faster
Functions are always static
2.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
How to add attributes to a class?
Assign in __init__
Use self.attribute = value
Use def keyword
Use import
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is inheritance in Python?
A class deriving from another
Copying a method
Making global variables
Running a loop
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How to override a parent method?
Redefine it in child class
Use override keyword
Use def twice
Use import
5.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
What is the difference between a class and an object?
Class is a blueprint
Object is an instance
Class is data
Object defines a class
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is math.floor(0o10)?
8
10
0
9
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is returned by int(math.pow(3, 2))?
6
9
error, third argument required
error, too many arguments
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Pretest Alpro Dasar

Quiz
•
University
15 questions
Quiz Pemrograman Python

Quiz
•
10th Grade - University
15 questions
Python for loop/lists

Quiz
•
9th Grade - University
15 questions
CMDP2063 Unix and C Programming

Quiz
•
University
15 questions
CMDP2063 Unix and C Programming (Revision)

Quiz
•
University
25 questions
UTS Struktur dan Organisasi Data

Quiz
•
University
20 questions
quiz1B1

Quiz
•
7th Grade - University
20 questions
Pemrograman Blokly

Quiz
•
9th Grade - University
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade