Create a function called isAscending that will take three int values. The function will return true if the numbers are in descending order and false if they are not. For instance, if the following sequence of three numbers was entered:

30 40 100

This would be ascending order because each number input is larger than the previous number input.

Your function should take input and produce output. Thismeans you should not have any print or input statements within the isDescending function.

Respuesta :

In python:

def isAscending(a, b, c):

   return True if a < b < c else False

We can test this function with the following line of code:

print(isAscending(30,40,100)). This will print True to the console because the numbers are in ascending order.

I hope this helps!

Following are the Python code to define the method that is "isAscending" which accepts three parameters:

Program:

def isAscending(a, b, c):#defining the method isAscending that takes three parameters

   if(a<b<c):#defining if block that checks value in assending order

       return True#return value that is True

   else:#defining else block

       return False#return value that is False

a=30#Initilizing value 30 in a variable

b=40#Initilizing value 40 in b variable

c=100#Initilizing value 100 in c variable

print(isAscending(a,b,c))#using print method that calls isAscending method

output:

Please find the attachef file.

Program Explanation:

  • Defining the method "isAscending" that takes three parameters that are "a,b, and c".
  • Inside the method defining if block that checks value in assending order, and return value that is "True".
  • In the else block it use return value that is "False".
  • Outside the method three integer variable "a,b, and c" is declared that initilizes with the value that is "30, 40, and 100".
  • Using a print method that calls "isAscending" method that prints the return value.

Find out more about the method here:

brainly.com/question/18881441

Ver imagen codiepienagoya
RELAXING NOICE
Relax