+ 1

Como criar uma função em python?

O que é função, como usar, pra que usar e um exemplo disso

8th Oct 2024, 5:58 PM
Luan Vitor
Luan Vitor - avatar
1 Answer
+ 2
Hello Luan Vitor ! Why use functions? Reusability: You can use the same function multiple times in a program. Modularity: Functions break a complex problem into smaller parts. Readability: Makes the code easier to understand and debug. This is how to create one👇👇 # Define the function def greet(name): return f"Hello, {name}!" # Call the function print(greet("Aisha"))
9th Oct 2024, 5:38 PM
ShadowCipher
ShadowCipher - avatar