• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 11 páginas
Examen

python questions and answers

Document preview thumbnail
Vista previa 2 fuera de 11 páginas

python questions and answers

Vista previa del contenido

WGUpoD335poPracticepoTestpo2
Studypoonlinepoatpohttps://quizlet.com/_ezi
szg
1. Createpoaposolutionpothatpoacceptspothreepointegerpoinputsporepresentingpothepon
umberpoofpotimespoanpoemployeepotravelspotopoapojobposite.poOutputpothepototalpodi
stancepotraveledpotopotwopodecimalpoplacespogivenpothepofollowingpomilespoperpoem
ployeepocommutepotopothepojobposite.poOutputpothepototalpodistancepotraveledpotopo
twopodecimalpoplacespogivenpothepofollowingpomilespoperpoemployeepocommutepo
topothepojobposite:
EmployeepoA:po15.62pomil
espoEmployeepoB:po41.85p
omiles

EmployeepoC:po32.67pomiles:potimes_traveledApo=point(input())potimes
_traveledBpo=point(input())
times_traveledCpo=point(input())poempl
oyeeApo=po15.62po#milespoemployeeB
po=po41.85po#milespoemployeeCpo=po32

.67po#miles
distance_traveledApo=potimes_traveledApo*poemploye
eApodistance_traveledBpo=potimes_traveledBpo*poempl
oyeeBpodistance_traveledCpo=potimes_traveledCpo*poe
mployeeC
total_miles_traveledpo=podistance_traveledApo+podistance_traveledBpo+podistance_tr
av-poeledC
print('Distance:po{:.2f}pomiles'.format(total_miles_traveled))
2. Createpoaposolutionpothatpoacceptspoanpoinputpoidentifyingpotheponamepoofpoapotextp
ofile,poforpoexample,po"WordTextFile1.txt".poEachpotextpofilepocontainspothreeporowspo

withpoonepowordpoperporow.poUsingpothepoopen()pofunctionpoandpowrite()poandporea
d()pomethods,pointeractpowithpothepoinputpotextpofilepotopowritepoaponewposentencep
ostringpocomposedpoofpothepothreepoexistingpowordspotopothepoendpoofpothepofilepoc

ontentspoonpoaponewpoline.poOutputpotheponewpofilepocontents.:pofile_namepo=poinpu
t()
withpoopen(file_name,po'r')poaspof:
word1po=postr(f.readline()).strip(
)poword2po=postr(f.readline()).stri
p()poword3po=postr(f.readline()).
strip()

fpo=poopen(file_name,po'r')pol
inespo=pof.read().splitlines()p
olinespo=po'po'.join(lines)pof.cl

ose()
print(f'{word1}\n{word2}\n{word3}\n{lines}')
1po/
po1
1

, WGUpoD335poPracticepoTestpo2
Studypoonlinepoatpohttps://quizlet.com/_ezi
szgpoaposolutionpothatpoacceptspoanpointegerpoinputporepresentingpoanyponu
3. Create
mberpoofpoounces.poOutputpothepoconvertedpototalponumberpoofpotons,popounds,po
andporemainingpoouncespobasedpoonpothepoinputpoouncespovalue.poTherepoarepo16po
ouncespoinpoapopoundpoandpo2,000popoundspoinpoapoton.:poounces_per_poundpo=po1
6




2po/
po1
1

Información del documento

Subido en
25 de diciembre de 2024
Número de páginas
11
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$13.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.
CLASSROOMGRADE
5.0
(1)
Vendido
25
Seguidores
3
Artículos
1208
Última venta
2 meses 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