Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4.2 TrustPilot
logo-home
Examen

CMPSC 101 MIDTERM 2 CORRECT 100%

Note
-
Vendu
1
Pages
2
Grade
A+
Publié le
26-02-2025
Écrit en
2024/2025

The Range(1,10,3) produces the values A. 1,4,7,10 B. 1,4,7 C. 1,3,5,7,9 D. 1,10,3 - ANSWERB. 1,4,7 How many asterisks would be printed by these two code fragments? A. 12 in both cases B. 6 in both cases C. 12 in the one on the left; 6 in the one of the right D. 6 in the one on the left; 4 in the one on the right - ANSWERC. 12 in the one on the left; 6 in the one of the right If is_prime is a function that identifies whether its argument was prime, what would this short function return? A. The value 2 only B. The value 7 only C. All of the small primes in a list: [2,3,5,7] D. One small prime, and a different one each time it is called. - ANSWERA. The value 2 only I wish to catch invalid input values outside the range of 1 to 5, inclusive. The test to identify a bad input would be: A. value < 1 and value > 5 B. value < 1 or value > 5 C. 1 > value > 5

Montrer plus Lire moins
Établissement
CMPSC 101
Cours
CMPSC 101








Oups ! Impossible de charger votre document. Réessayez ou contactez le support.

École, étude et sujet

Établissement
CMPSC 101
Cours
CMPSC 101

Infos sur le Document

Publié le
26 février 2025
Nombre de pages
2
Écrit en
2024/2025
Type
Examen
Contient
Questions et réponses

Sujets

Aperçu du contenu

CMPSC 101 MIDTERM 2 CORRECT
100%
The Range(1,10,3) produces the values

A. 1,4,7,10
B. 1,4,7
C. 1,3,5,7,9
D. 1,10,3 - ANSWERB. 1,4,7

How many asterisks would be printed by these two code fragments?

A. 12 in both cases
B. 6 in both cases
C. 12 in the one on the left; 6 in the one of the right
D. 6 in the one on the left; 4 in the one on the right - ANSWERC. 12 in the one on
the left; 6 in the one of the right

If is_prime is a function that identifies whether its argument was prime, what would
this short function return?

A. The value 2 only
B. The value 7 only
C. All of the small primes in a list: [2,3,5,7]
D. One small prime, and a different one each time it is called. - ANSWERA. The
value 2 only


I wish to catch invalid input values outside the range of 1 to 5, inclusive. The test to
identify a bad input would be:

A. value < 1 and value > 5
B. value < 1 or value > 5
C. 1 > value > 5
D. value < 1 and > 5 - ANSWERB. value < 1 or value > 5

A series of inputs will arrive at the keyboard, ending with an empty line. Assuming all
of these inputs are whole numbers, compute their sum. - ANSWERtotal = 0
line = input()
while line != '':
total = total + int(total)
line = input()

Given a list of integers in nums display the first value greater than 60 and its position
in that list. - ANSWERposition = 0
while nums[position] <= 60:
position = position + 1
€11,81
Accéder à l'intégralité du document:

Garantie de satisfaction à 100%
Disponible immédiatement après paiement
En ligne et en PDF
Tu n'es attaché à rien


Document également disponible en groupe

Faites connaissance avec le vendeur

Seller avatar
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
papersbyjol West Virginia
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
421
Membre depuis
2 année
Nombre de followers
253
Documents
13986
Dernière vente
2 semaines de cela

3,8

72 revues

5
27
4
18
3
17
2
2
1
8

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions