Variables
Syntax
Python
Machine Language
Compiled Language
100

What is a variable in programming?

A variable is a container that holds data that can change, like a box that you can put different things in.

100

What is syntax in programming?

Answer: Syntax refers to the rules for writing code correctly in a programming language.


100

What is Python?

Answer: Python is a high-level programming language that is easy to read and write.

100

What is machine language?

Answer: Machine language is the lowest level of programming language, consisting of binary code (ones and zeros) that computers can understand directly.

100

What is a compiled language?

Answer: A compiled language is a programming language whose code is translated into machine language before it is run.

200

Give an example of a variable name you could use in a program.

Answer: "score" or "age".

200

Why is it important to follow syntax rules when coding?

Answer: Following syntax rules ensures the code runs correctly and the computer understands what to do.

200

What is one thing you can do with Python?

Answer: You can create games, websites, or analyze data.

200

Why is machine language difficult for humans to use?

Answer: Because it uses binary code, which is hard to read compared to letters and numbers.

200

Name one example of a compiled language.

Answer: C++ or Java.

300

What do we call values that never change in a program?

Answer: Constants.

300

What happens if you make a syntax error in your code?

Answer: The program will not run or will crash because the computer cannot understand the incorrect instructions.

300

Why do many beginners like to learn Python?

Answer: Because its syntax is simple and easy to understand.

300

What do computers use machine language for?

Answer: To execute instructions and perform tasks.

300

What is the benefit of using a compiled language?

Answer: Compiled programs run faster and can use more system resources.

400

How do you assign a value to a variable in Python?

Answer: You use the equals sign, like this: variable_name = value.

400

Can syntax rules be different in different programming languages?

Answer: Yes, each programming language has its own syntax rules.

400

What does the command print("Hello World") do in Python?

Answer: It displays the text "Hello World" on the screen.

400

Can programmers write programs directly in machine language?

  • Answer: Yes, but it's very complex and not practical for most tasks.
400

What is the process called when you turn code into machine language?

Answer: Compiling.

500

What is the purpose of using variables in a program?

Answer: They help store information that can be used and changed throughout the program.

500

Give an example of a simple syntax error.

Answer: Forgetting to close a parenthesis, like in print("Hello World".

500

How do you create a variable in Python?

Answer: By using the equals sign, like this: my_variable = 10.

500

How does machine language differ from programming languages like Python?

Answer: Machine language is made of binary code, while programming languages use syntax that is easier for humans to read and write.

500

What is a downside of compiled languages?

Answer: You need to compile the code each time you make changes before running it again.