Basic Programming
Python
Python Symbols
Python Code
Other Programming Knowledge
100

What is the symbol used to represent comments in Python?

(#) symbol

100

This function prints whatever is given to it.

print()

100

This is the operator used to concatenate

+

100

4**2 is equal to this number.

16

100

This is what we call a sequence of instructions that accomplish a goal.

program

200

What is the difference between "==" and "=" in Python?

==" is a comparison operator used to check if two values are equal, while "=" is an assignment operator used to assign a value to a variable.

200

This is a way of repeating a set of code many times

loop

200

This symbol is used to comment out one line of code

#

200

This code would return:

x,y = 1,2

print(x - y + x * y)

1

200

Another name for coffee, this programming language was invented in 1995

Java

300

What is the syntax for printing "Hello, World!" to the console in Python?

print("Hello, World!")

300

Variables can be defined both inside or outside of a function. This determines if a variable is inside or outside of the function.

spacing or indent

300

This is used to create multi-line comments.

"""

300

This code outputs:

x = 3

If x == 3:

    print("x<5 and x<4")

error

300

Grace Hopper found the first of these inside a computer, which became the term we use to refer to flaws in the code we write

bugs

400

What is the syntax for creating a list in Python?

myList = [1, 2, 3, 4, 5]

400

This Code Outputs:

x = "12"

print(x - x +12)

error

400

This operation is represented by % to get the remainder.

modulo/modulus

400

Here's a bit of code. It would print:

season = "Spring is the best"
for i in range(5):
  print(season)

Spring is the best
Spring is the best
Spring is the best
Spring is the best
Spring is the best

400

Refers to the process of converting one data type into another

Type Conversion

500

The name of this operator:

!=

Not equal to

500

What does this function output?

x = 2

x +=6

x -=10

x *= -1

print(x)

if float(x) == 2:

    print("x is two")

elif x != 2:

    print("x is not two")

x is two

500

True or false:

There are 6 different data types in python

true

500

#Change a Range of Item Values 

thislist = ["apple", "banana", "cherry", "orange", "kiwi", "mango"] 

thislist[1:3] = ["blackcurrant", "watermelon"] 

print(thislist)

['apple', 'blackcurrant', 'watermelon', 'orange', 'kiwi', 'mango']

500

These are numbers with both a real and an imaginary part. The imaginary part is represented by the letter "j" or "J"

Complex Numbers (complex)