Python Flashcards
What is a decimal place known as in python?
A float number
What is a concatenation?
A concatenation is something that joins the text and the code
Eg. print(“35=“),35)
The “ , “ was the concatenation
Another concatenation is a “ + “
Variables in numbers:
What do you have to put before an input if it is a number?
You have to clarify that it is an integer,
Eg. number=int(input(“enter a number”))
Tip: make sure there is two brackets at the end whilst using an “int”
What is the python symbol for less than?
<
What is the python symbol for greater than?
>
What is the python symbol for less than or equal?
<=
What is the python symbol for greater than or equal?
> =
What is the python symbol for equals?
==
What is the python symbol for not equal?
!=
If’s and else’s: What is wrong with this? if num==10 print (“correct”) else print(“wrong”)
There is no “ : “ at the end of the if and else so there would be a syntax error.
Eg. if num==10”:”
else”:”
What is an iteration?
A loop
What is a for loop?
Repeats an instruction a set number of times
What is a while loop?
Repeats until condition is met
How do you finish a loop?
You use a break
How to you start a pseudo code?
START