Skip to content

Commit

Permalink
practice python
Browse files Browse the repository at this point in the history
  • Loading branch information
Keyvan-af committed Feb 4, 2024
1 parent 7bf4c4e commit 7bd6471
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions Python/Designer Door Mat/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![alt text](image.png)
Binary file added Python/Designer Door Mat/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions Python/Designer Door Mat/solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Enter your code here. Read input from STDIN. Print output to STDOUT
n,m=map(int,input().split())
mid=n//2
des='.|.'
cnt=1
for i in range(n):
if i==mid:
print('WELCOME'.center(m, '-'))
else:
print((des*cnt).center(m, '-'))
if i<mid:
cnt+=2
else:
cnt-=2
1 change: 1 addition & 0 deletions Python/Text_Wrap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
![alt text](<Screenshot 2024-02-04 062720.png>)
Binary file added Python/Text_Wrap/Screenshot 2024-02-04 062720.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions Python/Text_Wrap/solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import textwrap

def wrap(string, max_width):
return textwrap.fill(text=string, width=max_width)

if __name__ == '__main__':
string, max_width = input(), int(input())
result = wrap(string, max_width)
print(result)

0 comments on commit 7bd6471

Please sign in to comment.