Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge: Pyramid | Recursion and Lambda Functions
Python Functions Tutorial
course content

Contenido del Curso

Python Functions Tutorial

Python Functions Tutorial

1. What is Function in Python?
2. Positional and Optional Arguments
3. Arbitrary Arguments
4. Function Return Value Specification
5. Recursion and Lambda Functions

Challenge: Pyramid

Tarea

Edit a recursive function draw_pyramid that takes an integer height and prints a pyramid of asterisks with a height of height to the console.

Expected Output:

Conditions:

You need to fill in the blanks in the code (___) so that when the current height (current_height) exceeds the specified height of the pyramid (height), the program terminates. Otherwise, the program should continue drawing the next row of the pyramid with a recursive call to the function.

Tarea

Edit a recursive function draw_pyramid that takes an integer height and prints a pyramid of asterisks with a height of height to the console.

Expected Output:

Conditions:

You need to fill in the blanks in the code (___) so that when the current height (current_height) exceeds the specified height of the pyramid (height), the program terminates. Otherwise, the program should continue drawing the next row of the pyramid with a recursive call to the function.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 5. Capítulo 2
toggle bottom row

Challenge: Pyramid

Tarea

Edit a recursive function draw_pyramid that takes an integer height and prints a pyramid of asterisks with a height of height to the console.

Expected Output:

Conditions:

You need to fill in the blanks in the code (___) so that when the current height (current_height) exceeds the specified height of the pyramid (height), the program terminates. Otherwise, the program should continue drawing the next row of the pyramid with a recursive call to the function.

Tarea

Edit a recursive function draw_pyramid that takes an integer height and prints a pyramid of asterisks with a height of height to the console.

Expected Output:

Conditions:

You need to fill in the blanks in the code (___) so that when the current height (current_height) exceeds the specified height of the pyramid (height), the program terminates. Otherwise, the program should continue drawing the next row of the pyramid with a recursive call to the function.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Sección 5. Capítulo 2
toggle bottom row

Challenge: Pyramid

Tarea

Edit a recursive function draw_pyramid that takes an integer height and prints a pyramid of asterisks with a height of height to the console.

Expected Output:

Conditions:

You need to fill in the blanks in the code (___) so that when the current height (current_height) exceeds the specified height of the pyramid (height), the program terminates. Otherwise, the program should continue drawing the next row of the pyramid with a recursive call to the function.

Tarea

Edit a recursive function draw_pyramid that takes an integer height and prints a pyramid of asterisks with a height of height to the console.

Expected Output:

Conditions:

You need to fill in the blanks in the code (___) so that when the current height (current_height) exceeds the specified height of the pyramid (height), the program terminates. Otherwise, the program should continue drawing the next row of the pyramid with a recursive call to the function.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones

¿Todo estuvo claro?

Tarea

Edit a recursive function draw_pyramid that takes an integer height and prints a pyramid of asterisks with a height of height to the console.

Expected Output:

Conditions:

You need to fill in the blanks in the code (___) so that when the current height (current_height) exceeds the specified height of the pyramid (height), the program terminates. Otherwise, the program should continue drawing the next row of the pyramid with a recursive call to the function.

Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
Sección 5. Capítulo 2
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
We're sorry to hear that something went wrong. What happened?
some-alt