Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

PFP191 Questions and Answers 2024

Beoordeling
-
Verkocht
-
Pagina's
85
Cijfer
A+
Geüpload op
09-08-2024
Geschreven in
2024/2025

PFP191 Questions and Answers 2024 What is python? A. a code B. nothing C. a game D. a programming language ** Answ** D. a programming language Which of the following variables is the "most mnemonic"? A. x B. x1q3z9ocd C. hours D. variable_173 ** Answ** C. hours Which data structure is being put to use in the code given below?

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

PFP191 Questions and Answers 2024

What is python?

A. a code
B. nothing
C. a game
D. a programming language ** Answ** D. a programming language

Which of the following variables is the "most mnemonic"?
A. x
B. x1q3z9ocd
C. hours
D. variable_173 ** Answ** C. hours

Which data structure is being put to use in the code given below?
# Code starts
org = 'QuizOrbit'
count = {}
for i in org:
if i in count:
count[i]+=1
else:
count[i]=1
print(count)
# Code Ends

A. String
B. List
C. Tuple
D. Dictionary ** Answ** D. Dictionary

Which Of The Following Define The Set {'a', 'b', 'c'}:
A. s = {'a', 'b', 'c'}
B. s = set('a', 'b', 'c')
C. s = set('abc')
D. s = set(['a', 'b', 'c'])
E. s = {('a', 'b', 'c')} ** Answ** A. s = {'a', 'b', 'c'}
C. s = set('abc')
D. s = set(['a', 'b', 'c'])

What Python expression tests whether the string 'foo' is a member of set s? ** Answ**
'foo' in s

,You have a set s defined as follows:
s = {100, 200, 300}
Which one of the following statements does not correctly produce the union of s and the
set {300, 400, 500}:
A. s | [300, 400, 500]
B. s | {300, 400, 500}
C. s | ({300, 400, 500})
D. s | set([300, 400, 500])
E. s.union([300, 400, 500])
F. s.union(set([300, 400, 500])) ** Answ** A. s | [300, 400, 500]

What is the result of this statement:
{'b', 'a', 'r'} & set('qux')

A. {'b', 'r', 'a'}
B. {'q', 'r', 'x', 'u', 'b', 'a'}
C. {}
D. set() ** Answ** D. set()

What is the result of this statement:
{1, 2, 3, 4, 5} - {3, 4} ^ {5, 6, 7}

A. {1, 2, 6, 7}
B. set()
C. {1, 2}
D. {3, 4, 5, 6, 7} ** Answ** A. {1, 2, 6, 7}

Consider the following expression involving two sets x and y:
(x & y <= x) and (x & y <= y)
This expression is True for any sets x and y—true or false?
A. False
B. True ** Answ** B. True

What is the result of the highlighted expression:
>>> x = {1, 2, 3}
>>> y = {1, 2}
>>> persubset(x)

A. It raises an exception.
B. set()
C. True
D. False ** Answ** A. It raises an exception.

Suppose a set s is defined as follows:
s = {'foo', 'bar', 'baz', 'qux'}
Which of the following remove element 'bar' from s:

,A. s -= {'bar'}
B. s &= {'foo', 'baz', 'qux'}
C. s.discard('bar')
D. s.pop()
E. del s['bar']
F. s.difference_update({'bar'}) ** Answ** A. s -= {'bar'}
B. s &= {'foo', 'baz', 'qux'}
C. s.discard('bar')
F. s.difference_update({'bar'})

Which of the following are true for objects of Python's set type:
A. The order of elements in a set is significant.
B. A given element can't appear in a set more than once.
C. A set may contain elements that are mutable.
D. Sets are mutable. ** Answ** B. A given element can't appear in a set more than
once.
D. Sets are mutable.

What will be the output of above Python code?
str1="6/4"
print("str1")

A. 1
B. 6/4
C. 1.5
D. str1 ** Answ** D. str1

Which of the following will result in an error?
str1="python"

A. print(str1[2])
B. str1[1]="x"
C. print(str1[0:9])
D. Both (b) and (c) ** Answ** B. str1[1]="x"

What will be the output of below Python code?
str1="Information"
print(str1[2:8])

A. format
B. formatio
C. orma
D. ormat ** Answ** A. format

What will be the output of below Python code?

, str1="Aplication"
str2=str1.replace('a','A')
print(str2)

A. application
B. Application
C. ApplicAtion
D. applicAtion ** Answ** C. ApplicAtion

What is a correct syntax to output "Hello World" in Python?
A. print("Hello World")
B. echo("Hello World");
C. p("Hello World")
D. echo "Hello World" ** Answ** A. print("Hello World")

What will be the output of below Python code?
str1="poWer"

str1.upper()

print(str1)

A. POWER
B. Power
C. power
D. poWer ** Answ** D. poWer

What will the below Python code will return? If

str1="save paper,save plants"
str1.find("save")

A. It returns the index position of the last occurance of "save" in the given string str1.
B. It returns the last index position of the last occurance of "save" in the given string
str1.
C. It returns the last index position of the first occurance of "save" in the given string
str1.
D. It returns the first index position of the first occurance of "save" in the given string
str1. ** Answ** D. It returns the first index position of the first occurance of "save" in
the given string str1.

Which of the following will give "Simon" as output?
If str1="John,Simon,Aryan"

A. print(str1[-7:-12])
B. print(str1[-11:-7])

Geschreven voor

Vak

Documentinformatie

Geüpload op
9 augustus 2024
Aantal pagina's
85
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

$15.99
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kun je een ander document kiezen. Je kunt het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF


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.
smartchoices Chamberlain College Of Nursing
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
36
Lid sinds
5 jaar
Aantal volgers
5
Documenten
4499
Laatst verkocht
4 weken geleden

4.8

9 beoordelingen

5
7
4
2
3
0
2
0
1
0

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

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen