I wrote my code in python 3.8:
def max_magnitude(num1, num2):
return num1 if abs(num1) > abs(num2) else num2
print(max_magnitude(-8,-2))
I hope this helps!
Any time you pass an argument to a method, the data type arguments must be assignment compatible with data type receiving parameter.
<span />
Answer:
SyntaxError.
Explanation:
https://www.quora.com/In-Python-what-kind-of-error-is-returned-by-the-following-code-e-g-NameError-ValueError-IOError-etc-def-my_func-n1-n2-return-n1-n2-my_func-1-2-3 sorce site
<h2>
</h2><h2>
</h2><h2>
</h2><h2>
brainlest plz</h2>
On the one hand it looks pretty cool, on the other hand change is good
Answer:
Following are the expression to this question:
if (young and famous==True):
Explanation:
For print, the given expression the code requires some modification that can be defined as follows:
young = True#defining a bool variable that holds a value True
famous = True#defining a bool variable that holds a value True
if (young and famous==True):#defining if block that check variable value
print('You must be rich!')#print message
else:#else block
print('There is always the lottery...')#print message
Output:
You must be rich!
Code explanation:
In the above-given code, two variable "young and famous" is declared, that hold a "True" which is a bool value, in this code, a conditional statement has used, that checks variable value, which can be defined as follows:
- In the if block, it uses the above declared variable with and gate to check its value is equal to true.
- If the condition is true, it will print the true block message, otherwise, go to the else block in this, it will print the else block message.