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 receives a number from the input and checks whether the number is segmented to 5. Tips: The numeric is on 5 segments that remain the remaining 5 zero
Write a program that receives 2 numeric value from the input and stores in variables A and B. Then move the values of these two variables (the value of variable A is to be stored within B and the value of variable B is saved within a)
1- The user selects a number from 0 to 100 in his mind 2- The program guesss the user's desired number 3- The user according to the guessing number is one of the options (the correct guess, the number is larger, the number ... Moore ...
Write a function that receives a list (array) as a parameter, and deletes its duplicate items and returns the new (array) list
Write a program that receives a number and from that number to 0 countdown is required between each number of 1 second pauses
Write a class called Tarikh to receive a solar date in yyyy/mm/dd format and has methods to add and reduce (day, month and year) of date. Also have a method for printing the date on the output. ...
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.