Data types
Variable
operators
Miscellaneous
logic
100

What is the data type of decimal numbers

float

100

What is a variable

Variable is storage container

100

What's the operator for modulus

% (aka remainder)

100

what would be the first thing Python does here:

print(2+3**3**2)

3**2, as ** is right-associative operator

100

What is the symbols for comment?

#

200

What's the data type of a variable?

a=400.56

float

200

which one is the valid variable name?

_sa_area

&sa_area

1sa_area


_sa_area

200

What's the operator for integer division

// (aka quotient)

200

What is the str() function?

type casting function, returns String value of the argument

200

Which operator is evaluated first:

a= 10*3+7/5-4

a) =

b)/

c)*

d)-

* , then /, then + and -, and finally =

(a= 10*3+7%5-4)

300

what are the  3 basic data types in Python

int,float and string

300

In Python, a variable may be assigned a value of one type, and then later re-assigned a value of a different type:

True or False

True

300

What's the output of this

a=21/2

b=21%2

c=21//2

10.5,1,10

300

What's the value of this expression?

2+3*10+10%2*10

32

300

What is string concatenation

the process of appending one string to the end of another string

400

correct or incorrect?

a=20.3

print("The value of a is"+str(a))

correct

400

What's the type() function used for ?

to tell the data type of a variable, i.e. class int etc.

400

what's the output of this?

20+10*3-(15-7)+27//2

55

400

What's the value of this expression?

118+2+10*19*(10+10)*2%2

120

400

What's the output of this?

name="100"

print("The value of the name is\n" +name)

The value of the name is 

100

500

what's the output of this?

a=int(123.45)

b=12.3

print(a+b)

135.3

500

x=100

y=35

y+=x

print(y)

135 (as += is short for y=y+x)

500

What 7 arithmetic operators do we have in python

+,-,*,**,/,//,%

500

What's the output of this?

a=200.34

b=200.3

print(a==b)

False

500

What's the output?

a=100

b=200

print(a>=b)

False