The name Python comes from —- —-
Monty Python!
a = 3
is an example of —- —–
variable assignment
Python is different from Java and C++ when it comes to variables in that…
How do you call a function in Python?
Explain through an example
E.g. print("hello")
How do you write comments in Python?
By using the # symbol
How can you identify a code block within Python?
For example:
if spam_amount > 0:
print("But I don't want ANY spam!")Give an example of operator overloading
viking_song = "Spam " * spam_amount
What type of variable is this?a = 3.5
Float
How can you find out the type of variable in Python?
type(spam_amount)
How can I found out the following floor division
10 / 3 = 3
i.e. ignore the fraction of the quotient
a // b
How can I found it the following modulus
10 / 3 = 1
i.e. integer remainder, after division
a % b
How can I convert the following…
6.75 -> 6
int(6.75)
How do you add a cell in notebooks below the current cell?
Click in current cell
Hit escape
Type the letter “b”