Escrito por estudiantes que aprobaron Inmediatamente disponible después del pago Leer en línea o como PDF ¿Documento equivocado? Cámbialo gratis 4,6 TrustPilot
logo-home
Document preview thumbnail
Vista previa 3 fuera de 24 páginas
Examen

ENGR 102 EXAM 2 EXAM WITH CORRECT ACTUAL QUESTIONS AND CORRECTLY WELL DEFINED ANSWERS LATEST ALREADY GRADED A+

Document preview thumbnail
Vista previa 3 fuera de 24 páginas

ENGR 102 EXAM 2 EXAM WITH CORRECT ACTUAL QUESTIONS AND CORRECTLY WELL DEFINED ANSWERS LATEST ALREADY GRADED A+

Vista previa del contenido

ENGR 102 EXAM 2 EXAM WITH CORRECT
ACTUAL QUESTIONS AND CORRECTLY
WELL DEFINED ANSWERS LATEST
ALREADY GRADED A+



mylist = [5, 3, 7, 9, 1, 2]
mylist.pop()
mylist.insert(2, 4)
mylist.sort()
for i in mylist:
print(i, end = ' ') - ANSWERS-# Q32
mylist = [5, 3, 7, 9, 1, 2]
mylist.pop()
mylist.insert(2, 4)
mylist.sort()
for i in mylist:
print(i, end = ' ')
# output
# 1, 2, 3, 5, 7, 9

,number = input("Enter a number: ") # assume the user
enters 5.0
try: x = int(number)
print("x is the integer", x)
except: x = float(number)
print("x is the float", x) - ANSWERS-# Q33
number = input("Enter a number: ") # assume the user
enters 5.0
try:
x = int(number)
print("x is the integer", x)
except:
x = float(number)
print("x is the float", x)
# output
# ** user enters 5
# x is the integer 5
# ** user enters 5.9
# x is the float 5.9
# if program has decimal will print as float

, List 5 good coding practices that have been mentioned in
this course. - ANSWERS-# Q1
# always comment your code
# keep your code simple
# test your code often, work through it in groups
# be consistent with your code
# use good identifying variables
# write as few of lines as possible


2. In the following dictionary, identify the keys and values.
Write the command to add the items 'Orange' and 1 to the
dictionary. What does the command print(mydict.items())
output to the console? mydict = {'Apple' : 3, 'Pear' : 5,
'Banana' : 2} - ANSWERS-# Q2
mydict = {'Apple' : 3, 'Pear' : 5, 'Banana' : 2}
mydict['Orange'] = 1
print(mydict.items()) # prints items as list
print(mydict) # **** whats diff ??? ****
# cannot do this, a dictionary does not have append or add
# mydict.append("'Orange' : 1")

Información del documento

Subido en
17 de junio de 2026
Número de páginas
24
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas
$16.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
NurseLNJ
4.8
(478)
Vendido
454
Seguidores
117
Artículos
8596
Última venta
18 horas hace


Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes