Variables and Loops
שאלות 10
מפתח התשובות מוצג למורים מחוברים.
-
Purpose of a variable
What is the main purpose of a variable in a computer program?
To permanently fix a value that can never change
To draw graphics on the screen
To store a value that can be referenced and changed later
To connect the computer to the internet
Think about a labeled box that holds information the program can use and update. -
-
-
-
-
-
-
-
Infinite loop risk
Which problem is most likely to cause an infinite loop in a while loop?
The condition uses the less-than operator
The loop variable is never updated inside the loop
The loop body contains a print statement
The loop is written with indentation
If the condition never becomes False, the loop never stops. -
Type conversion
What does the expression int("12") do in most beginner programming languages?
Deletes the variable named int
Creates a Boolean value True
Converts the integer 12 into the text "12"
Converts the text "12" into the integer 12
Look at what the function name suggests: it changes one type into another, specifically into an integer.
פרטים
- מקצועות
- מדעי המחשב נוסף על ידי AI שפות תכנות
- תגיות
- נוסף על ידי AI loops נוסף על ידי AI for loop נוסף על ידי AI while loop נוסף על ידי AI data types נוסף על ידי AI infinite loop
- קהל יעד
- חטיבת ביניים · כיתות ז׳–ט׳
- רמת קושי
- 5 מתוך 10
- שפה
- אנגלית
- מי יכול לראות
- כולם
- הושלם על ידי AI
- מה שמסומן בניצוץ נוסף על ידי AI.
- נוצר באמצעות AI
- Claude Haiku 5.5
- נוצר
תגובות