Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge 1 | Assigning a Default Value to a Parameter
Python Functions: From Zero to Hero

book
Challenge 1

Tâche

Swipe to start coding

You have to rewrite this code so it's permissible.

Solution

def function(z, w, x = 10, y = 20):
print(x + y + z + w)

function(5, 10)

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 3. Chapitre 2
def function(x = 10, y = 20, z, w):
print(x + y + z + w)

function(5, 10)

Demandez à l'IA

expand
ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

some-alt