jackfrued / jackfrued/Python-100-Days
D4打印各种三角形代码是否可以简化
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 187k
- Forks
- 55.8k
- PR merge metrics
- No merged PRs in 30d
Description
python小白代码不规范,如有问题请多多指教
row = int(input('请输入圣诞树的行数:'))
打印第一个三角形
for i in range(1, row + 1):
print('*' * i)
打印第二个三角形
for i in range(1, row + 1):
print(' '* (row - i), '*' * i)
打印第三个三角形
for i in range(1, row + 1):
print(' ' * (row - i), '*' * (2 * i - 1))
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Python snippet in the issue and run it with several row values to observe the three triangle outputs. Compare the repeated loops and identify whether they can be simplified without changing the displayed shapes. Done means a clearer equivalent implementation, but the issue does not name a repository file or test to update.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100