0
hi my coding instor told me to make a calculator that find the average of two numbers can you pls tell me my erro
print("the is a progarm that find the average of two numbers:") num=int(input("enter you num the program will find the anwer:")) num2=int(input("enter you num the program will find the anwer:")) print=(f"finding the anwer pls stand back{num} {num2} {num}+{num2}//{num2}")
3 Réponses
+ 2
19 hours ago brofar showed you the answer why are asking again?
Do you know how get the average of two numbers?
+ 2
use the existing thread to show your attempt.
https://www.sololearn.com/Discuss/3338938/?ref=app
your last print() is incorrect.
as already mentioned, you are not yet calculating the average. To calculate the average, sum up the 2 number and **then** divide by 2.
+ 2
dayeabasi kingsley ,
the issue is in the last line:
> print=(...) is not correct, the print function is shadowed
> the expression inside the f- string is not correct.
why you are not going to use a more simple way:
> take input for first number and store it in a variable
> take input for second number and store it in a variable
> add the 2 numbers and store the result in a variable
> output the result by dividing the sum of the numbers by 2