Average 2 pcs
Write a program that receives two users and prints the mean on output
Write a program that receives two users and prints the mean on output
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error' alert(msg)This answer is only visible to premium members
This answer is only visible to premium members
def calculate_average(): # Receive two numbers from the user num1 = float(input("لطفاً عدد اول را وارد کنید: ")) num2 = float(input("لطفاً عدد دوم را وارد کنید: ")) # Calculate the mean average = (num1 + num2) / 2 # Average printing print(f"میانگین دو عدد {num1} و {num2} برابر است با: {average}") # Implementation of the function calculate_average()
class Math: def __init__(self,num1,num2): self.num1=num1 self.num2=num2 def Way(self): return (self.num1+self.num2)/2 num1=int(input("enrer your number1:")) num2=int(input("enter your number2:")) obj=Math(num1,num2) print(obj.Way())
def cp(a,c): global s s = (a + c)/2 print(s) a = int(input("number1:")) c = int(input("number2:")) cp(a,c)
def average(num1,num2): ave = (num1 + num2)/2 return ave a = float(input("number 1: ")) b = float(input("number 2: ")) print("average is: ",average(a,b))
a=int(input( 'num:')) b=int(input( 'num:')) print(a+b)
# Getting user input
number1 = float(input("Enter the 1st number: "))
number2 = float(input("Enter the 2nd number: "))
# Calculating the average
sum = number1 + number2
average = lambda: sum / 2
print(f"Average: {average()}")
def miyangin(n,m): c = (m + n) / 2 return c print(miyangin(m=int(input("enter your m:")),n=int(input("enter your n:"))))
Submitting answers is currently unavailable.
Write a program that translates the following words from Farsi to English and vice versa. The program must be implemented infinitely and it is possible to add new words easily words: Hello = hello goodbye = bye Kata ...
Write a program that prints paired numbers between 1 and 100
Write a function that receives the number of hours of employee work per month as a parameter and calculates the amount of employee salaries according to the formula below and returns each employee for 2 hours of work per month, per hour at 4 ...
Write a function that receives a word and changes each letter to its next letter in the alphabet. Then returned the result. Indeed: "A" turns into "B" "" B "becomes" C "" C "becomes" D "and ........
We have a list of different items along with their discount percent and we want to know how much the final price of each product is after considering the discount. Write a program that gets the product price as below and the percentage of discount ...
You must be logged in to access this section.
Login/Sign up If you don’t understand the exercise or can’t solve it for any reason, that’s completely
normal—don’t worry 😊
Try checking out easier exercises and reviewing different answers
submitted by others. Gradually, you can move on to more challenging exercises. Also, your answer
might be correct even if it’s different from others.