- 2

Python 3 Tutorial

So in the Function Arguments part of the Python 3 tutorial, the last question, I put in my answers, they were all highlighted green, but it said incorrect, I'm not sure what I did wrong, help/

22nd Jul 2020, 5:28 PM
Tristan Cummings
Tristan Cummings  - avatar
3 Respuestas
+ 1
I hope this is the question: ♤♢☞ 𝐊𝐢𝐢𝐛𝐨 𝐆𝐡𝐚𝐲𝐚𝐥 ☜♢♤ Here's my explanation: def even(x): if x%2 ==0: print("Yes") else: print("No") "def" defines a function and this function is named as "even" which will take 1 argument named temporarily as "x" in defining a function. Now, this function will check whether the argument given is even or not by simply dividing it by 2.(As you know, that even numbers are divisible by 2). If it's divided by 2(or it's even) it will print "Yes" and if it's not divided by 2 (if it's odd) then, it will print "No". Please don't ask like this. You should give the question and then we'll help you easily.
22nd Jul 2020, 6:17 PM
Arctic Fox
Arctic Fox - avatar