printのendの初期値は\nですが、endに値を与えると与えた値で終わりになり、改行しなくなる
逆にprint()なら改行のみになる
temp = input('请输入一个整数:')
number = int(temp)
while number:
i = number - 1
while i:
print(' ', end='')
i = i - 1
j = number
while j:
print('*', end = '')
j = j - 1
print()
number = number - 1
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme