100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Tentamen (uitwerkingen)

Python Exam 1 Questions Correctly Answered.

Beoordeling
-
Verkocht
-
Pagina's
22
Cijfer
A+
Geüpload op
06-04-2025
Geschreven in
2024/2025

Python Exam 1 Questions Correctly Answered. What is the output of: 11.0//2 - CORRECT ANSWER 5.0 Floor division to the nearest whole number Returns a float What is the output of: 11//2 - CORRECT ANSWER 5 Return an int What is the output of: 11/2 - CORRECT ANSWER 5.5 Returns a float What is the output of: 11/2.0 - CORRECT ANSWER 5.0 What is the output of: 20%2 - CORRECT ANSWER 0 What is the output of: 21%2 - CORRECT ANSWER 1 What is the output of: 11%3 - CORRECT ANSWER 2 x = 'Texas A&M University' x [-3] = ? - CORRECT ANSWER i x = 'Texas A&M University' x [3] = ? - CORRECT ANSWER a x = 'Texas A&M University' len(x) = ? - CORRECT ANSWER 20 x = 'Texas A&M University' x [0:5:2] = ? - CORRECT ANSWER Txs It starts at 0 and ends at 5, incremented by 2 x = 'Texas A&M University' x [4:] = ? - CORRECT ANSWER s A&M University x = 'Texas A&M University' x [:4] = ? - CORRECT ANSWER Texa x = 'Texas A&M University' 'A' in x = ? - CORRECT ANSWER True Acts as a Boolean, determines if it is in the string x = 'Texas A&M University' 't' in x = ? - CORRECT ANSWER True x = 'Texas A&M University' 'A&M' in x = ? - CORRECT ANSWER True x = 'Texas A&M University' ' ' in x = ? - CORRECT ANSWER True x = 'Texas A&M University' ' ' in x = ? - CORRECT ANSWER False 2**1+1 - CORRECT ANSWER 3 3* 1**3 - CORRECT ANSWER 3 2*(3+1) - CORRECT ANSWER 4 6+4/2 - CORRECT ANSWER 8.0 Returns a float due to the division len('Hello world') = ? - CORRECT ANSWER 11 Be sure to count the spaces as values int(-2.3) = ? - CORRECT ANSWER -2 float(32) = ? - CORRECT ANSWER 32.0 str(3.14159) = ? - CORRECT ANSWER 3.14159 [0] * 4 = ? - CORRECT ANSWER [0, 0, 0, 0] [1, 2, 3] * 3 = ? - CORRECT ANSWER [ 1, 2, 3, 1, 2, 3, 1, 2, 3] x = 1 y = 0 x >= 2 and (x/y) >2 = ? - CORRECT ANSWER False x = 6 y = 2 x >= 2 and (x/y) >2 = ? - CORRECT ANSWER True x = 1 y = 0 x >= 2 and y != 0 and (x/y) >2 = ? - CORRECT ANSWER False What is the purpose of the "def" keyword in Python? - CORRECT ANSWER It indicates that start of a function It indicates that the follow indented section of code id to be stored for later What will the following Python program print out? def fred(): -> print ("Zap") def jane(): -> print ("ABC") jane() fred() jane() - CORRECT ANSWER ABC Zap ABC What will the following Python program print out? count = 0 for number in [3, 41, 12, 9, 74, 15]: -> count = count + 1 print('Count: ', count) - CORRECT ANSWER Count: 6 What will the following Python program print out? total = 0 for number in [3, 41, 12, 9, 74, 15]: -> total = total + number print('Total: ', total) - CORRECT ANSWER 154 It will add all of the numbers together What will the following Python program print out? cheeses = ['Cheddar', 'Edam', 'Gouda'] 'Edam' in cheeses - CORRECT ANSWER True What will the following Python program print out? count = 0

Meer zien Lees minder
Instelling
PYTHON.
Vak
PYTHON.










Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
PYTHON.
Vak
PYTHON.

Documentinformatie

Geüpload op
6 april 2025
Aantal pagina's
22
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

Python Exam 1 Questions Correctly
Answered.

What is the output of: 11.0//2 - CORRECT ANSWER 5.0

Floor division to the nearest whole number

Returns a float



What is the output of: 11//2 - CORRECT ANSWER 5

Return an int



What is the output of: 11/2 - CORRECT ANSWER 5.5

Returns a float



What is the output of: 11/2.0 - CORRECT ANSWER 5.0



What is the output of: 20%2 - CORRECT ANSWER 0



What is the output of: 21%2 - CORRECT ANSWER 1



What is the output of: 11%3 - CORRECT ANSWER 2



x = 'Texas A&M University'

x [-3] = ? - CORRECT ANSWER i



x = 'Texas A&M University'

x [3] = ? - CORRECT ANSWER a

,x = 'Texas A&M University'

len(x) = ? - CORRECT ANSWER 20



x = 'Texas A&M University'

x [0:5:2] = ? - CORRECT ANSWER Txs

It starts at 0 and ends at 5, incremented by 2



x = 'Texas A&M University'

x [4:] = ? - CORRECT ANSWER s A&M University



x = 'Texas A&M University'

x [:4] = ? - CORRECT ANSWER Texa



x = 'Texas A&M University'

'A' in x = ? - CORRECT ANSWER True

Acts as a Boolean, determines if it is in the string



x = 'Texas A&M University'

't' in x = ? - CORRECT ANSWER True



x = 'Texas A&M University'

'A&M' in x = ? - CORRECT ANSWER True



x = 'Texas A&M University'

' ' in x = ? - CORRECT ANSWER True



x = 'Texas A&M University'

' ' in x = ? - CORRECT ANSWER False

, 2**1+1 - CORRECT ANSWER 3



3* 1**3 - CORRECT ANSWER 3



2*(3+1) - CORRECT ANSWER 4



6+4/2 - CORRECT ANSWER 8.0

Returns a float due to the division



len('Hello world') = ? - CORRECT ANSWER 11

Be sure to count the spaces as values



int(-2.3) = ? - CORRECT ANSWER -2



float(32) = ? - CORRECT ANSWER 32.0



str(3.14159) = ? - CORRECT ANSWER 3.14159



[0] * 4 = ? - CORRECT ANSWER [0, 0, 0, 0]



[1, 2, 3] * 3 = ? - CORRECT ANSWER [ 1, 2, 3, 1, 2, 3, 1, 2, 3]



x=1

y=0

x >= 2 and (x/y) >2 = ? - CORRECT ANSWER False



x=6

y=2

x >= 2 and (x/y) >2 = ? - CORRECT ANSWER True
€11,35
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten


Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
ROSEGRADES Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
214
Lid sinds
2 jaar
Aantal volgers
87
Documenten
12160
Laatst verkocht
3 weken geleden
TOPGRADE

I HELP STUDENTS WITH REVISION MATERIALS WITH BETTER GRADES GUARANTEED. BEST OF LUCK.

3,4

30 beoordelingen

5
10
4
3
3
11
2
2
1
4

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