#๐ Could anyone help with my python homework pleaseeee
14 messages ยท Page 1 of 1 (latest)
@mighty bramble
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
Closes after a period of inactivity, or when you send !close.
I don't know how to do starting in vpl2
What's vpl2?
What code do you have so far?
print(
def printPattern(pattern, size):
if pattern == 'a':
for i in range(size):
if i == 0 or i == size - 1:
print('#' * size)
else:
print('#' + ' ' * (size - 2) + '#')
elif pattern == 'b':
for i in range(size):
print(' ' * i + '#')
elif pattern == 'c':
for i in range(size):
print(' ' * (size - i - 1) + '#')
elif pattern == 'd':
for i in range(size):
if i == 0 or i == size - 1:
print('#' * size)
else:
print('#' + ' ' * (i - 1) + '#')
# Example usage:
if __name__ == "__main__":
pattern = input().strip()
size = int(input())
printPattern(pattern, size))
```py
Follow the instructions from the bot
Add py after the 3 backticks
First 3
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.