Python Basics Quiz

Quiz
•
Other, Education, Computers
•
6th - 10th Grade
•
Hard
Standards-aligned
Sagar Das
Used 56+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is a variable?
Variables are those which delete programs
A variable is an entity which stores some values
Values stored in a variable can't be changed
A variable is something used to repeat steps
Answer explanation
Variables are entities which store values.
Values stored in a variable can be changed.
Tags
Variables
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
"def" keyword is used in python to-
def is a variable
define a new conditional variable
use conditional
define a new function
Answer explanation
def is used to define a new function
Syntax for a new function definition is-
def functionName(attribute):
<functionDefinition>
return <returnValue>
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
enemy = hero.findNearestEnemy( )
What is findNearestEnemy( ) ?
It is a null function
It is a function of the object hero called "method"
a variable
function definition
Answer explanation
findNearestEnemy( ) is the function defined to be used by the "hero" object.
Functions defined for the objects are called "methods".
findNearestEnemy( ) is a method.
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
enemy = hero.findNearestEnemy( )
in the variable enemy what is being stored?
The name of the nearest enemy if present
The nearest enemy object if present
it is a conditional to check if enemy is present
hero.findNearestEnemy( ) is a method to find the nearest enemy
Answer explanation
hero.findNearestEnemy( ) is the method of the hero object which stores the name of the nearest enemy(a string) if found in the "enemy" variable.
example:
>> enemy = hero.findNearestEnemy( )
>> print(enemy)
>> Jazz #This is the name of the enemy which is a string
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
Which of the following symbols is used in the beginning of a line to create a single line comment in Python?
&&
@
*
#
Answer explanation
The "#" symbol is used in the beginning of a line to create a single line comment in Python.
Example:-
# hi there, today is a wonderful day
6.
FILL IN THE BLANK QUESTION
45 sec • 1 pt
def goToDistance(x, y):
hero.moveXY(___)
Fill in the blanks if using the goToDistance( ) function the hero needs to move to (34, 50)
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is a syntax?
Syntaxes are not written in a code to explain inner code workings
The symbols used in computer programming are called syntaxes
The rule following which different computer programs are written.
All are correct
Answer explanation
The rules following which computer programs are written are call syntaxes.
Different programming languages (C, C++, Python etc.) follow different rules hence differ by their syntaxes
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
CS2_Tổng Kết

Quiz
•
6th - 8th Grade
10 questions
Code Combat Review (Python)

Quiz
•
8th Grade
12 questions
Code Combat Kithgard Dungeons

Quiz
•
6th - 8th Grade
20 questions
Preguntas sobre Python y CodeCombat 2.0

Quiz
•
6th - 8th Grade
15 questions
Quiz tổng kết khóa học

Quiz
•
6th - 8th Grade
10 questions
Code Combat

Quiz
•
10th Grade
20 questions
Campbell's Hero's Journey

Quiz
•
9th - 12th Grade
20 questions
The Hero's Journey

Quiz
•
6th - 12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Other
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
20 questions
One Step Equations All Operations

Quiz
•
6th - 7th Grade