#๐Ÿ”’ Output terminal wont work properly

29 messages ยท Page 1 of 1 (latest)

keen flume
#

i got back to python after a long break for C, and my terminal doesnt seem to work preoperly for a simple half triangle code.

honest wadiBOT
#

@keen flume

Python help channel opened

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.

keen flume
#
    for i in range(1, n + 1):
        for j in range(1, i + 1):
            print("* ", end="")
        print("")

# Example: Print a half pyramid with 5 rows
n = 5
half_pyramid(n)
honest wadiBOT
#

Hey @keen flume!

Please edit your message to use a code block

Add a py after the three backticks.

```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
keen flume
#

this is the code

#

thats literally a google searched code when mine didnt work

#

but it still wont work

compact igloo
#

!e```py
def half_pyramid(n):
for i in range(1, n + 1):
for j in range(1, i + 1):
print("* ", end="")
print("")

Example: Print a half pyramid with 5 rows

n = 5
half_pyramid(n)```

honest wadiBOT
violet hinge
#

make sure you saved the file

compact igloo
#

it seems to work fine

keen flume
#

i did save it

tight cargo
keen flume
#

right

#

but when i run it, output pops up instead of terminal

compact igloo
#

are you running the correct file?

keen flume
#

yep

tight cargo
#

can you try running it directly from the terminal instead of the shortcut?

keen flume
#

how do i do that?

#

oh shit

#

it works

#

i pressed the run button from top left

#

but how did that shortcut affect the code

#

?

#

wait, now even the short cut button works, but it still runs in the output tab

#

weird

#

well, thanks yall

honest wadiBOT
#
Python help channel closed for inactivity

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.