
Jessica M. answered 01/28/24
Tutor
New to Wyzant
PhD with 5+ years of tutoring Computer Science
Hello Cherish,
Here is a snippet of the code using Python language:
# Sample inputs
x = float(input("Enter the value of x: "))
y = float(input("Enter the value of y: "))
# Calculate average
avg = (x + y) / 2
# Display the result
print(avg)
The code takes 2 inputs, calculates the average then prints it out as an output.