Functions within Functions
Inside the function, we can not only write loops, declare variables, use if-else
statements but also call other functions. Let's look at an example.
1234567def function_1(): # Outer function print('I am an outer function') def function_2(): # Inner function print('I am an inner function ') function_2() function_1()
Swipe to start coding
You have to implement two functions:
- outer_function - this is an outer function that displays text like this:
The perimeter of this square is equal to:
- inner_function - this is an inner function, which calculates the perimeter of a square whose side is
7
.
Solução
Obrigado pelo seu feedback!
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Awesome!
Completion rate improved to 5.56Awesome!
Completion rate improved to 5.56
Functions within Functions
Inside the function, we can not only write loops, declare variables, use if-else
statements but also call other functions. Let's look at an example.
1234567def function_1(): # Outer function print('I am an outer function') def function_2(): # Inner function print('I am an inner function ') function_2() function_1()
Swipe to start coding
You have to implement two functions:
- outer_function - this is an outer function that displays text like this:
The perimeter of this square is equal to:
- inner_function - this is an inner function, which calculates the perimeter of a square whose side is
7
.
Solução
Obrigado pelo seu feedback!
single
Awesome!
Completion rate improved to 5.56
Functions within Functions
Deslize para mostrar o menu
Inside the function, we can not only write loops, declare variables, use if-else
statements but also call other functions. Let's look at an example.
1234567def function_1(): # Outer function print('I am an outer function') def function_2(): # Inner function print('I am an inner function ') function_2() function_1()
Swipe to start coding
You have to implement two functions:
- outer_function - this is an outer function that displays text like this:
The perimeter of this square is equal to:
- inner_function - this is an inner function, which calculates the perimeter of a square whose side is
7
.
Solução
Obrigado pelo seu feedback!