-
-
Save arhun/303d8e6479dd048ce6269f719c4e1f81 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 1 | |
def convert(miles): | |
return miles * 1.609 | |
# 2 | |
def area(a, b): | |
return a * b | |
# 3 (первый вариант - с использованием if) | |
def is_even(a): | |
if a % 2 == 0: | |
return True | |
else: | |
return False | |
# 3 (второй вариант - более короткий) | |
def is_even(a): | |
return a % 2 == 0 # тоже возвращается bool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment