Programming basics Flashcards
What is sequence in programming?
Code is executed line by line, one after the other
What is syntax?
The grammatical rules of a programming language
What is exponentiation?
Raising a number to a power (e.g., ‘8**2’ means 8 raised to the power of 2, which is 64)
What is Modulus?
It finds the remainder when one number is divided by another (e.g., ‘10 % 3’ results in 1)
What does input () do?
It asks the user for input, such as their name, age, or other data
How do you respond to user input in python?
You can use ‘print’ to respond with messages or calculations based on user input.
What are constants and variables in programming?
Constants hold data that doesn’t change, while variables can change their values during program execution
What is assignment in programming?
It’s the process of giving a variable a value (e.g., ‘x=5’ assigns the value 5 to ‘x’
Syntax error
A mistake in the programming code that violates the grammatical rules of a language
Not equal to
Operator (!=) that checks whether the first number and the second number are not equal
CamelCase
A naming convention in which compound words are joined together, and each word’s in initial letter is capitalised (e.g., corePrice)
Data types
Categories of values that determine what operations can be performed on them (e.g., integers, strings and floats)
Floor division
Division that rounds down to the nearest whole number (// operator)
Debugging
The process of identifying and fixing errors or bugs in a program