arrow_forward همه ارسال‌ها

جزئیات ارسال کد#105

code_blocks
مسئله مربوطه: رسم شکل - مارپیچ (#13) arrow_outward
verified
وضعیت داوری نهایی: پذیرفته شد
terminal
زبان برنامه‌نویسی: Python
schedule
ارسال‌کننده و زمان:
Mujtablue io (۳ سال پیش)
descriptionsolution.py ۱۸ خط • ۳۵۱ بایت
1row, col = map(int, input().split())
2
3shape = ""
4
5right = False
6
7for n in range(1, row + 1):
8 if n % 2:
9 shape += "#" * col + "\n"
10 right = not right
11 continue
12 if right:
13 shape += "*" * (col - 1) + "#" + "\n"
14 else:
15 shape += "#" + "*" * (col - 1) + "\n"
16else:
17 print(shape)
18 del n
کد ارسال‌شده برای داوری خودکار هاتکدز UTF-8