4.1.1.Quiz Expressions&Variables - sj50179/IBM-Data-Science-Professional-Certificate GitHub Wiki

LATEST SUBMISSION GRADE 100% 1. Question 1 What is the result of the following code segment:1//2 ?

1 / 1 point

0.5

0

Correct correct // corresponds to integer division

Question 2 What is the value of x after the following lines of code?

x=1

x=x+1

1 / 1 point

1

2

4

Correct Correct: the value x=x+1 changes the value of x, if x is assigned to its self. It's helpful to replace the value of x with its current value in this case 1 or x=1+1.

Question 3 What is the result of the following operation 1+3*2 ?

1 / 1 point

7

12

8

Correct correct, Python follows the standard mathematical conventions

Question 4 In Python 3, what is the type of the variable x after the following: x=2/2 ?

1 / 1 point

float

int

Correct correct, in Python 3, regular division always results in a float