Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge 1 | Arguments or Parameters
Python Functions: From Zero to Hero

book
Challenge 1

Tâche

Swipe to start coding

You have to implement a function, named function(), with such arguments as a and b. This function tests whether a is greater than b, if so, displays ('OK').

To test, take these values as parameters a = 43, b = 6

Solution

def function(a, b):
if a > b:
print('OK')

function(43, 6)

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 2. Chapitre 2
# Write your function below
def ___(___, ___):
if ___:
___('___')

# Testing
function(___, ___)

toggle bottom row
some-alt