Professional Documents
Culture Documents
Capture D'écran . 2023-10-04 À 13.02.22
Capture D'écran . 2023-10-04 À 13.02.22
Create a function that returns first name and last name of somebody in one string
Hint: Example:
def fonction_2(first_name,last_name) :
fonction_2(‘Maxence’,’Duffuler’)
...
→ ‘Maxence Duffuler’
return ….
4 minutes Challenge n°3
Create a function that returns the minimum and the maximum of a list
Hint: Example:
def fonction_3(liste) :
fonction_3( [1,2,3,4,5] ):
...
→ 1,5
return minimum, maximum
Hint: Example:
for i in ….. :
[1,2,3,4,5] :
…..
→ 1,3,5
print( … )
Create a function that returns True if its length is above 10 (10 included)
Hint: Example:
def fonction_5( value ): fonction_5 ( ‘Anticonstitutionnellement’ )
if ….: → True
… fonction_5 ( ‘Okay’ )
→ False
8 minutes Challenge n°6
! Bonus challenge !
Work by group of 2
Create a function that returns the factorial of a number with a while loop
5 minutes Challenge n°7
Create a function that checks if the first number of a list and the last are the same
Hint: Example:
def fonction_7( liste ): fonction_7 ( [ 1, 2, 3, 4, 5] )
if ….: → False
Return … fonction_7 ( [ 1, 2, 3, 4, 1] )
→ True
7 minutes Challenge n°8
Hint:
Check if a number is even: Example:
num % 2 == 0
fonction_9 ( [ 1, 2, 3, 4, 5 ],[12, 13,14, 15] )
→ True : number is even
→ [ 1, 3, 5, 12, 14 ]
→ False : number is odd
Example:
fonction_10 ( ‘kayak’ )
→True
fonction_10 ( ‘test’ )
→ False