Sie sind auf Seite 1von 34

CMSC 11

Review
EZ Round
1. It is a sequence control that
performs a group of
statements repeatedly.
1. It is a sequence control that
performs a group of
statements repeatedly.

Looping Branching Sequence Function


1. It is a sequence control that
performs a group of
statements repeatedly.

Looping Branching Sequence Function


2. It is a Boolean expression
which evaluates to true or
false.
2. It is a Boolean expression
which evaluates to true or
false.

Function Condition Operator Object


2. It is a Boolean expression
which evaluates to true or
false.

Function Condition Operator Object


3. It defines which strings of
characters and symbols are
well formed.
3. It defines which strings of
characters and symbols are
well formed.

String Syntax Construct Semantic


3. It defines which strings of
characters and symbols are
well formed.

String Syntax Construct Semantic


4. True or False: Python
Variables are case-insensitive.

True False
4. True or False: Python
Variables are case-insensitive.

True False
5. What is the Result of the
statement 3*‘La’+’nd’ in
Python?
5. What is the Result of the
statement 3*‘La’+’nd’ in
Python?

“Llland” “Lalaland” Syntax None of


Error these
5. What is the Result of the
statement 3*‘La’+’nd’ in
Python?

“Llland” “Lalaland” Syntax None of


Error these
GG Round
6. What is the output of the code below?
x = 3
y = 17
while x < y:
y = y – 1
if x - y == 0:
print(y)
break
x = x + x % y
print(x)
6. What is the output of the code below?
x = 3
y = 17 6 6
while x < y: 12 12
10 0
y = y – 1
if x - y == 0:
print(y) 6
Infinite
break 12
Loop
x = x + x % y 24
print(x)
6. What is the output of the code below?
x = 3
y = 17 6 6
while x < y: 12 12
10 0
y = y – 1
if x - y == 0:
print(y) 6
Infinite
break 12
Loop
x = x + x % y 24
print(x)
7. Below is a program that counts the
even and odd numbers from 1 to N.
N = int(input("Enter N: "))
even_cnt = 0
odd_cnt = 0
7.
for i in range(1,_____):
if i%2 == 0:
even_cnt += 1
_________
odd_cnt += 1
print("Even count:",even_cnt)
print("Odd count:",odd_cnt)
7. Below is a program that counts the
even and odd numbers from 1 to N.
N = int(input("Enter N: "))
even_cnt = 0 N-1 N
odd_cnt = 0
7.
for i in range(1,_____):
if i%2 == 0:
None
even_cnt += 1
N+1 of
_________
these
odd_cnt += 1
print("Even count:",even_cnt)
print("Odd count:",odd_cnt)
7. Below is a program that counts the
even and odd numbers from 1 to N.
N = int(input("Enter N: "))
even_cnt = 0 N-1 N
odd_cnt = 0
7.
for i in range(1,_____):
if i%2 == 0:
None
even_cnt += 1
N+1 of
_________
these
odd_cnt += 1
print("Even count:",even_cnt)
print("Odd count:",odd_cnt)
8. Below is a program that counts the
even and odd numbers from 1 to N.
N = int(input("Enter N: "))
even_cnt = 0
odd_cnt = 0
for i in range(1,_____):
if i%2 == 0:
even_cnt += 1
8.
_________
odd_cnt += 1
print("Even count:",even_cnt)
print("Odd count:",odd_cnt)
8. Below is a program that counts the
even and odd numbers from 1 to N.
N = int(input("Enter N: "))
even_cnt = 0 exit continue

odd_cnt = 0
for i in range(1,_____):
if i%2 == 0:
None
even_cnt += 1
break of
8.
_________
these
odd_cnt += 1
print("Even count:",even_cnt)
print("Odd count:",odd_cnt)
8. Below is a program that counts the
even and odd numbers from 1 to N.
N = int(input("Enter N: "))
even_cnt = 0 exit continue

odd_cnt = 0
for i in range(1,_____):
if i%2 == 0:
None
even_cnt += 1
break of
8.
_________
these
odd_cnt += 1
print("Even count:",even_cnt)
print("Odd count:",odd_cnt)
9. What is the output of the code below?
i = 1
while i < 3:
for j in range(1,3):
print(i*j, end=" ")
print()
9. What is the output of the code below?
i = 1
while i < 3:
for j in range(1,3):
print(i*j, end=" ")
print()

12 12 123 Infinite
24 6 24 246 Loop
9. What is the output of the code below?
i = 1
while i < 3:
for j in range(1,3):
print(i*j, end=" ")
print()

12 12 123 Infinite
24 6 24 246 Loop
10. What is the output of the code below?
for i in range(0,3):
for j in range(0,3):
if i >= j:
print('*', end="")
print()
10. What is the output of the code below?
for i in range(0,3):
for j in range(0,3):
if i >= j:
print('*', end="")
print()

*** *** *
*** ** ** *
*** * *** **
10. What is the output of the code below?
for i in range(0,3):
for j in range(0,3):
if i >= j:
print('*', end="")
print()

*** *** *
*** ** ** *
*** * *** **
thanks!
Any questions?
You can find/ask me at
C-118
exer.mbbderobles@gmail.com
Credits
Special thanks to all the people who made and released
these awesome resources for free:
✘ Presentation template by SlidesCarnival
✘ Photographs by Unsplash

Das könnte Ihnen auch gefallen