
Python Programming Basics - MP2 Study
Flashcard
•
Computers
•
10th Grade
•
Practice Problem
•
Medium
Allyson Smith
Used 2+ times
FREE Resource
Student preview

9 questions
Show all answers
1.
FLASHCARD QUESTION
Front
What is a conditional statement in Python?
Back
A conditional statement in Python allows the program to execute certain pieces of code based on whether a condition is true or false. Examples include if, elif, and else statements.
2.
FLASHCARD QUESTION
Front
How do you assign user input to a variable in Python?
Back
You can assign user input to a variable using the input() function. For example:
user_input = input('Enter something: ')
3.
FLASHCARD QUESTION
Front
What is a for loop in Python?
Back
A for loop in Python is used to repeat code a certain number of times. Ex:
for i in range(4):
forward(10)
4.
FLASHCARD QUESTION
Front
How do you assign a new value to a variable in Python?
Back
You can assign a new value to a variable by using the assignment operator '='. For example:
x = 5
x=10
After both lines are run x will equal 10.
5.
FLASHCARD QUESTION
Front
What is an extended for loop in Python?
Back
for i in range(10,51,5)
i will start at 10, increase 5 each time and stop when it reaches 51.
6.
FLASHCARD QUESTION
Front
How do you use 'i' in a for loop in Python?
Back
You can use i in the block of code as a counter.
for i in range(5):
print(i)
This will print 0 1 2 3 4
7.
FLASHCARD QUESTION
Front
How do you use the mod operator to check for even or odd numbers in Python?
Back
Mod returns the remainder. You can use the mod operator '%' to check for even or odd numbers. If a number % 2 equals 0, it is even; otherwise, it is odd.
num=5
num%2=1
Access all questions and much more by creating a free account
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
Already have an account?
Similar Resources on Wayground
12 questions
Organic 2 Exam 4 Review
Flashcard
•
KG
6 questions
melting and boiling flashcards
Flashcard
•
10th Grade
6 questions
Belongings Movement
Flashcard
•
KG
6 questions
School Objects
Flashcard
•
KG
4 questions
Untitled Flashcards
Flashcard
•
9th - 12th Grade
9 questions
Medical Conditions and Symptoms
Flashcard
•
KG
11 questions
3D Design Vocabulary Flashcard
Flashcard
•
10th Grade
10 questions
Separação de Misturas para 9º Ano
Flashcard
•
9th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
20 questions
Figurative Language Review
Quiz
•
6th Grade