• ¿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 4 fuera de 51 páginas
Examen

Wgu D335 Introduction To Programming In Python - Performance Assessment (Pa) 100 Coding Practice Questions With Verified Solutions

Document preview thumbnail
Vista previa 4 fuera de 51 páginas

WGU D335 INTRODUCTION TO PROGRAMMING IN PYTHON - PERFORMANCE ASSESSMENT (PA) 100 CODING PRACTICE QUESTIONS WITH VERIFIED SOLUTIONS

Vista previa del contenido

WGU D335 INTRODUCTION TO
PROGRAMMING IN PYTHON -
PERFORMANCE ASSESSMENT (PA)
100 CODING PRACTICE
QUESTIONS WITH VERIFIED
SOLUTIONS

SECTION ONE: QUESTIONS 1–100


Question 1
Problem: Write a program that takes an integer input from the user and
prints "Even" if the number is even, and "Odd" if the number is odd.
Solution:
python
num = int(input())
if num % 2 == 0:
print("Even")
else:
print("Odd")

RATIONALE: The modulus operator % returns the remainder. If num
% 2 == 0, the number is evenly divisible by 2, making it even.

,Question 2
Problem: Write a program that takes two integer inputs and prints their
sum, difference, product, and quotient (as a float).
Solution:
python
a = int(input())
b = int(input())
print("Sum:", a + b)
print("Difference:", a - b)
print("Product:", a * b)
print("Quotient:", a / b)

RATIONALE: Basic arithmetic operations are performed in Python.
Division / always returns a float. Output formatting must match exactly
as shown.


Question 3
Problem: Write a program that takes a string input and prints it in
reverse order.
Solution:
python
text = input()
print(text[::-1])

RATIONALE: The slice [::-1] starts at the end and moves backwards
with a step of -1, effectively reversing the string.

,Question 4
Problem: Write a program that takes a list of three integers and prints
the largest number.
Solution:
python
a = int(input())
b = int(input())
c = int(input())
largest = max(a, b, c)
print("Largest:", largest)

RATIONALE: The built-in max() function returns the highest value
among its arguments.


Question 5
Problem: Write a program that takes a temperature in Celsius and
converts it to Fahrenheit. Formula: F = (C * 9/5) + 32. Output to one
decimal place.
Solution:
python
celsius = float(input())
fahrenheit = (celsius * 9/5) + 32
print("Fahrenheit: {:.1f}".format(fahrenheit))

RATIONALE: The conversion formula is applied. .1f formats the
output to one decimal place.

, Question 6
Problem: Write a program that takes a string input and counts the
number of vowels (a, e, i, o, u) in it.
Solution:
python
text = input().lower()
vowels = "aeiou"
count = 0
for char in text:
if char in vowels:
count += 1
print("Vowels:", count)

RATIONALE: The string is converted to lowercase to handle
uppercase inputs. Each character is checked against the vowel set.


Question 7
Problem: Write a program that takes an integer n and prints all
numbers from 1 to n on a single line, separated by spaces.
Solution:
python
n = int(input())
for i in range(1, n + 1):
print(i, end=" ")

RATIONALE: range(1, n+1) generates numbers from 1 to n
inclusive. end=" " keeps output on one line with spaces.

Información del documento

Subido en
5 de septiembre de 2026
Número de páginas
51
Escrito en
2026/2027
Tipo
Examen
Contiene
Preguntas y respuestas
$26.99

¿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.
Vendido
263
Seguidores
6
Artículos
3355
Última venta
10 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