Quiz
CST 100 Midterm
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem Quiz (27)
1What is the output:
x =49
if x!=0:
print("exclamation")
else:
print("no exclamation")- Aexclamation
- Bno exclamation
- Cerror
- Ddoesn't print anything
2By convention python scripts are stored as text files with extension?
- A.py
- B.p
- C.python
- D.pyt
3Python is considered an ________ language
- Acomposed
- Binterpreted
- Cinteractive
- Dcompied
4At python language interpreter's prompt, consider>>> 3 + 2 if above input is given and enter is hit then output should be ?
- A2
- B3
- C3+2
- D32
- E5
- Fcompiling...
5What is the output:
number = 99
def check_x():
if False:
print(“number is greater")
elif False:
print("number is less ")
else:
print("number is equal to")
check_x()- Anumber is greater
- Bnumber is less
- Cnumber is equal to
- Dno output will be printed
6What is the output:
x =49
if x >= 49:
print(“XLIX")
elif x!=0:
print("exclamation")
else:
print("no exclamation")- Aexclamation
- Bno exclamation
- CXLIX
- Ddoesn't print anything
7What is the output:
x =49
if x!=0:
print("exclamation")
else:
print("no exclamation")- Aexclamation
- Bno exclamation
- Cerror
- Ddoesn't print anything
8What is the output:
>>> greeting = 'Hello World'
>>> greeting[0] = 'J'- AHello World
- BJello World
- CError
- Dnull
9What is the output:
x = 1
for i in range(2):
for j in range(2):
x += 1
print(x)- AThis will result in an error
- B4
- C3
- D1
- E5
10for i in range (2) :
for j in range (2) :
print(i,j)- A0 0
1 1
2 2 - B0 0
0 1
1 0
1 1 - C0 0
0 1
0 2
1 0
1 1
1 2 - D0 0
0 1
0 2
1 0
1 1
1 2
2 0
2 1
2 2
- A0 0
11What is the output:
a = 3
b = 2
c = a ** b
print(c)- A6
- B9
- C8
- D5
12What is the output:
a = 4
b = 3
c = a * b
c += 1
print(c)- A7
- B'c'
- C12
- D13
- E1
- FThere is a syntax error
- GThere is a runtime error
13What is the output:
a = 7
b = 3
c = a % b
print(c)- A7
- B'c'
- C2
- D3
- E1
- FThere is a syntax error
- GThere is a runtime error
14What is the output:
a = 7
b = 3
c = a // b
print(c)- A7
- B2
- C'c'
- D3
- E1
- FThere is a syntax error
- GThere is a runtime error
15What is the output:
a73_ = 7
b_27 = 3
c = a73_ + b_27
print(c)- A100
- B10
- C'c'
- D73
- EThere is a runtime error
- FThere is a syntax error
16What is the output:
3bears = ['mamma', 'pappa', 'baby']
print(3bears)- A['mamma', 'pappa', 'baby']
- B3bears
- Cmamma, pappa, baby
- DThere is a syntax error
- EThere is a runtime error
17What is the output:
a=3
b=4
a=5
print(a)- A4
- B3
- Ca
- D5
- EThere is a runtime error
18What is the output:
a = 3
b = 4
a == 5
print(a)- A5
- BThere is a syntax error
- Ca
- D3
- E4
19What is the output:
a = 3
b = 4
c = a == 5
print(c)- A4
- B3
- Cc
- DFalse
- ETrue
- FThere is a syntax error
- G5
20What is the output:
a = 3
b = 4
if a == 5:
print('yes')- Ayes
- B'yes'
- C3
- D5
- EFalse
- FTrue
- GThere is a syntax error
- HThere is a runtime error
- INothing is printed
21a = 3
b = 4
if a == b
print('yes')- Ayes
- B'yes'
- C3
- D5
- EFalse
- FTrue
- GThere is a syntax error
- HThere is a runtime error
- INothing is printed
22How should I fix the error:
a = 3
b = 4
if a == b
print('yes')- AAssign 4 to a in line 1
- BAssign 3 to b in line 2
- CRemove an equal sign from line 3
- DChange the indentation of line 4
- EAdd parenthesis around the condition of the if statement in line 3
- FAdd a colon to the end of line 3
- GAdd an else clause after line 4
- HThere is no error
23What is the output:
a = 3
b = 4
if a > b:
print('yes')
else:
print('no')- AYes
- Bno
- Cyes
- D3
- E5
- FTrue
- GThere is a syntax error
- HFalse
24What is the output:
a = 3
b = 4
c = b
b = a
a = c
print( 'a : ' , a, 'b : ', b)- Aa: 3 b : 4
- Ba : 3, b : 4
- Ca : 4 b : 3
- Da: 4, b: 3
- E('a:',3,'b:',4)
- FThere is a syntax error
- GThere is a runtime error
25Which produces this output:
Hello, world- Aprint(Hello, world)
- Bprint('Hello, world')
- Cprint('Hello', 'world')
- Dprint("Hello", "world")
26Which produces this output:
0 1 2 3 4 5 6 7 8 9- Afor i in range(10):
print(i) - Bfor i in range (10):
print(i, end=' ') - Cfor i in range (9):
print (i) - Dfor i in range (9):
print(i, end=' ')
- Afor i in range(10):
27What is the output:
for i in range (1, 9):
print(i, end=' ')- A1 2 3 4 5 6 7 8
- B12345678
- C0 1 2 3 4 5 6 7 8 9
- D0123456789
- EThere is a syntax error
- F1 2 3 4 5 6 7 8 9
Informationen
- Beschreibung
- Quiz am CST 100 Midterm, erstellt von Kaitlin Troska am 12/02/2016.
- Autor
- Kaitlin Troska
- Sprache
- English
- Aufrufe
- 1
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz