Answer:
I don't understand what the question is asking
Explanation:
Answer:
#here is function in python
#function that return integer if input can be converted to int
#if not it will return a string "Cannot converted!!"
def get_integer(inp):
try:
return int(inp)
except:
return "Cannot convert!!"
print()
#call the function with different inputs
print(get_integer("5"))
print(get_integer("Boggle."))
print(get_integer(5.1))
print()
Explanation:
Define a function get_integer() with a parameter.In this function there is try and except.First try will execute and if input can be converted to integer then it will convert it into integer and return it.If it will not able to convert the input into integer then except will return a string "Cannot convert!!".In the function get_integer(), there is no use of any conditionals or type function.
Output:
5
Cannot convert!!
5
We can assume that the acidity of the river has a pH value of at least 6 or greater. We know this because given that clams die if acidity is less than 6 and frogs die when acidity is less than 4, if they both survive, acidity must not be lower than 6 pH
The function that replaces the values in an array is as follows:
def replace_elem(a, integer1, integer2):
for i in range(len(a)):
if a[i] == integer1:
a[i] = integer2
return a
print(replace_elem([7, 4, 10, 3, 7, 2, 4, 5], 4, 6))
<h3>Code explanation.</h3>
The code is written in python.
- We defined a function named "replace_elem". The function accepts an array a, and integers integer1 and integer2.
- Then, we used a loop to loop the index of the array.
- If any of the index value is equals to the integer1, we replace it with integer2.
- Then return the new values of the array a.
- Finally, we call the function with its parameters.
learn more on function here: brainly.com/question/15691123