There are two modes when a cell is highlighted.

- create a new cell above the current cell: a
- create a new cell below the current cell: b
- delete the current cell: dd
- change the current cell’s type to “Code”: y
- change the current cell’s type to “Markdown”: m

- execute the current cell and create a new cell: SHIFT + ENTER

`x`

which represents the standing of an athlete at an Olympics event.¶In [ ]:

```
```

```
if grade >= 90:
print("You got an A!")
if grade >= 80:
print("You got a B!")
if grade >= 70:
print("You got a C!")
if grade >= 60:
print("You got a D!")
if grade >= 50:
print("You got an F!")
```

```
if i < j:
if j < k:
i = j
else:
j = k
else:
if j > k:
j = i
else:
i = k
print("i =", i, " j =", j, " k =", k)
```

(a) i = 3,j = 5,and k = 7

(b) i = 3,j = 7,and k = 5

(c) i = 5,j = 3,and k = 7

`and`

, `or`

and `not`

. The `not`

operator has the highest precedence and should be evaluated first. Then evaluate `and`

before `or`

.¶In the following, note that evaluating `or`

before `and`

in the following gives a different and **incorrect** answer.
What is the value of `b`

?

```
x = 2
y = 4
z = 5
b = z > 2 or x > 3 and y < 3
```

Test your code!:

- x = 4 should print 4.
- x = 12 should print "Fizz".
- x = 10 should print "Buzz".
- x = 45 should print "FizzBuzz".

In [ ]:

```
x = int(input("Enter a positive integer. "))
# This is a comment. fill out your code below.
```

`y`

in the following? Try it first then run the code to check your answer.¶1)

```
x = 30
y = "a" if x > 15 else "b"
```

2)

```
x = 15
y = "a" if x > 15 else "b"
```

3)

```
x = 10
y = "a" if x > 15 else "b" if x >=11 else "c"
```

4)

```
x = 12
y = "a" if x > 15 else "b" if x >=11 else "c"
```

5)

```
x = 35
y = "a" if x > 15 else "b" if x >=11 else "c"
```

`y`

represents a year. A leap year is a year that is divisible by 4 and not by 100 unless it is divisible by 400. For example, 4, 2008, and 1600 are leap years but not 1700. Write a segment of code that determines whether `y`

is a leap year. Do it in two ways: 1) Use if/elif/else statements. 2) Use only boolean logical operators `and`

, `or`

and `not`

.¶`y`

.¶In [4]:

```
# method 1, use if/elif/else
y = 1324
```

In [10]:

```
# method 2, use boolean operators and, or and not
# fill in the boolean expression for isLeap below
y = 2400
isLeap =
print(isLeap)
```

In [ ]:

```
```