Trying to understand the ā€˜returnā€™ keyword | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Trying to understand the ā€˜returnā€™ keyword

def swap(x, y): x, y = y, x return(x,y) x = 5 y = 10 swap(x, y) #print(x,y) #Does the return function only give an output if there is ā€˜printā€™ in the code, for example the # on line 9.

28th Sep 2021, 2:43 PM
Jenkins
1 Resposta
0
Jay Matthews thank you!
28th Sep 2021, 4:22 PM
Jenkins