def Delta(x):
if x==0:
y=1;
else:
y=0;
return(y)
Answers
The Delta function returns 1 when the input is 0.
Complete question:
Considering the function delta, when does the function return the value 1?
Given co-de is:
def Delta(x):
if x==0:
y=1
else:
y=0
return y
Explanation:
- The value x is sent as the parameter to the function Delta. So, consider x as input.
- In the if condition, we clearly see that if the value of x is 0, then 1 is assigned to the variable y.
- Any number other than 0 as input to the function in the form of x will result in triggering else block and 0 is assigned to y.
- So, to assign 1 to the variable y, the x value should be 0. Then, if the condition passes, y is stored with 1 and the function returns the value in y which is 1.
- Therefore, The function returns the value 1 when the input is 0.
Learn more:
1. Ch+=2 is equivalent to
brainly.in/question/21331324
2. A CSS file cannot be linked to a web page. State True or False.
brainly.in/question/21107345
Answer:
The Delta function returns 1 when the input is 0.
Complete question:
Considering the function delta, when does the function return the value 1?
Given co-de is:
def Delta(x):
if x==0:
y=1
else:
y=0
return y
Explanation:
The value x is sent as the parameter to the function Delta. So, consider x as input.
In the if condition, we clearly see that if the value of x is 0, then 1 is assigned to the variable y.
Any number other than 0 as input to the function in the form of x will result in triggering else block and 0 is assigned to y.
So, to assign 1 to the variable y, the x value should be 0. Then, if the condition passes, y is stored with 1 and the function returns the value in y which is 1.
Therefore, The function returns the value 1 when the input is 0.
Learn more:
1. Ch+=2 is equivalent to
brainly.in/question/21331324
2. A CSS file cannot be linked to a web page. State True or False.
brainly.in/question/21107345