100% tevredenheidsgarantie Direct beschikbaar na je betaling Online lezen of als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

python control strucures questions with correct answers.

Beoordeling
-
Verkocht
-
Pagina's
6
Cijfer
A+
Geüpload op
25-03-2026
Geschreven in
2025/2026

python control structures

Instelling
Probability
Vak
Probability

Voorbeeld van de inhoud

Python Control Structures Quiz

1. What is the last thing printed by the following program?

start = 30 stop = 10 for I in range(start, stop - 1, -5): if I % 2 == 0: print(I *

2) else: print(I): 20

2. We want to simulate constantly flipping a coin until we get 3 heads in a

row. What kind of loop should we use?: While Loop

3. How many times will the following program print "hello"?: This code will loop

infinitely

4. The following code continually asks the user for a password until they

guess the correct password, then ends. But there is one problem.: Add a break; statement

after line 6 so that the program doesn't loop infinitely

5. What will the following program print when

run? for j in range(2): for I in range(6, 4, -1):

print (): 6

5

6

1/
6

, 5

6. What is the value of the Boolean variable can_ vote at the end of this

program?



age = 17 is _citizen = True can _vote = age >= 18 and is citizen: False

7. What will be the output of this program?




number = 5 greater_ than _zero = number > 0 if greater_ than _zero:

print(number): 5

8. What will be the output of this program?




number = 5 greater than zero = number > 0 if greater than zero: if number >

5: print(number): Nothing will print

9. What is printed by the following program?




Is raining = False is _cloudy = False is_ sunny = not is _raining and not is_ cloudy

is _summer = False is_ warm = is _sunny or is _summer print("Is it warm: " +
2/
6

Geschreven voor

Instelling
Probability
Vak
Probability

Documentinformatie

Geüpload op
25 maart 2026
Aantal pagina's
6
Geschreven in
2025/2026
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden
$12.89
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Online lezen of als PDF
Geen vaste maandelijkse kosten

Maak kennis met de verkoper
Seller avatar
smartthinker1
4.0
(2)

Maak kennis met de verkoper

Seller avatar
smartthinker1 Walden University
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
4
Lid sinds
2 jaar
Aantal volgers
3
Documenten
927
Laatst verkocht
1 jaar geleden

4.0

2 beoordelingen

5
1
4
0
3
1
2
0
1
0

Populaire documenten

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen