Basics Python

Flashcard
•
Computers
•
8th - 10th Grade
•
Hard
Wayground Content
FREE Resource
Student preview

12 questions
Show all answers
1.
FLASHCARD QUESTION
Front
Sophia is learning programming and wants to know how to define(assign) variables. Which of the following is the correct way? Options: var="String", func==Hello, var : 123, word= Hello
Back
var="String"
Answer explanation
The correct way to define a variable in programming is using the syntax 'var="String"'. This assigns the string value 'String' to the variable 'var'. The other options are incorrect due to syntax errors.
2.
FLASHCARD QUESTION
Front
Emma is writing a program and wants to insert a command that will take the output to the next line. Which one should she use? Options: \t, \n, /n, \\
Back
\n
Answer explanation
Emma should use '\n' to insert a newline in her program. This escape sequence represents a line break, while '\t' adds a tab, '/n' is incorrect, and '\' is an escape character without a specific function here.
3.
FLASHCARD QUESTION
Front
Michael is learning to code and wants to know the command used to display numbers and text on the screen. What should he use?
Back
Answer explanation
Michael should use the 'Print' command to display numbers and text on the screen. This command is commonly used in many programming languages to output information to the console.
4.
FLASHCARD QUESTION
Front
Priya is writing a Python program to calculate the total cost of items in a shopping cart. What symbol should she use to assign the total cost to a variable?
Back
=
Answer explanation
In Python, the '=' symbol is used for assignment. Priya should use '=' to assign the total cost of items in the shopping cart to a variable. The other options do not serve this purpose.
5.
FLASHCARD QUESTION
Front
Abigail is writing a Python script and wants to include a line that Python won't try to run as code. What should she use?
Back
Comment
Answer explanation
In Python, comments are used to include notes or explanations in the code that the interpreter ignores. Abigail should use a comment (preceded by #) to ensure that the line is not executed as code.
6.
FLASHCARD QUESTION
Front
Kai is learning about data types in his computer science class. He comes across a data type that can have one of two values: True or False. What is this data type called?
Back
Boolean
Answer explanation
The data type that can have one of two values, True or False, is called a Boolean. This is fundamental in programming for making decisions and controlling the flow of execution.
7.
FLASHCARD QUESTION
Front
Maya is organizing a coding workshop and needs to choose the correct data type for storing the number of participants. What data type should she use for a whole number?
Back
Integer
Answer explanation
Maya should use the Integer data type to store the number of participants, as it is designed for whole numbers. Float is for decimal numbers, Boolean for true/false values, and String for text.
Create a free account and access millions of resources
Similar Resources on Wayground
11 questions
Final Exam review

Flashcard
•
10th Grade
9 questions
OSI Model

Flashcard
•
9th - 12th Grade
9 questions
Python Variables

Flashcard
•
9th Grade
10 questions
Python

Flashcard
•
7th - 8th Grade
10 questions
Python

Flashcard
•
7th - 8th Grade
15 questions
Key Python Data Types

Flashcard
•
9th Grade
9 questions
Intro to Python Unit 6 Vocabulary Flashcards

Flashcard
•
9th - 12th Grade
6 questions
CSF 7.1 Assessment - Data Science as Storytelling

Flashcard
•
9th - 12th Grade
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
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade
29 questions
AP CSP Unit 2 Review (Code.org)

Quiz
•
10th - 12th Grade