You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

83 lines
2.0 KiB
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{
"cells": [
{
"cell_type": "markdown",
"id": "caa5f142",
"metadata": {},
"source": [
"# Рисуем лестницу #"
]
},
{
"cell_type": "markdown",
"id": "cf46f7d9",
"metadata": {},
"source": [
"Эта задачка чуть сложней предыдущей и потребует от вас размышлений. Мы будем рисовать лестницу.\n",
"\n",
"На вход ваша программа будет получать количество ступенек.\n",
"\n",
"```python\n",
"import sys\n",
"\n",
"num_steps = int(sys.argv[1])\n",
"```\n",
"\n",
"Ваша цель напечатать на экран лесенку используя символы пробела \" \" и решетки \"#\". Например, для входного параметра (количества ступенек) 4 лесенка должна выглядеть следующим образом:\n",
"\n",
"```\n",
" #\n",
" ##\n",
" ###\n",
"####\n",
"```\n",
"\n",
"Конечно, мы будем подавать на вход вашей программе разное количество ступенек."
]
},
{
"cell_type": "code",
"execution_count": 10,
"id": "9d3cc6ed",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
" #\n",
" ##\n",
" ###\n",
" ####\n",
" #####\n"
]
}
],
"source": [
"! python stairs.py 5"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}