#πŸ”’ Got an error again coding tic tac toe

48 messages Β· Page 1 of 1 (latest)

austere valve
#

PS C:\Users\pc> & C:/Python314/python.exe "c:/Users/pc/import tkinter.py"
File "c:\Users\pc\import tkinter.py", line 33
return
^^^^^^
SyntaxError: 'return' outside function
PS C:\Users\pc>

eternal oreBOT
#

@austere valve

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.

austere valve
#

wait let me sent the code rq

golden hornet
austere valve
austere valve
golden hornet
#

I am, but I'm asking you a separate question

austere valve
#

not really sure

golden hornet
#

What were you trying to use it for if you don't know what it does?

austere valve
#

if its an all ready taken spot return it so it dosent work.

#

wait i got an idea

golden hornet
#

return is the result of calling a function, but it's often used to exit the function early (since functions do not move beyond the return)

austere valve
#

I have so much errors rn so

golden hornet
#

but your code is not inside a function right now

austere valve
#

im kinda new to this so i dont understand most of the stuff lol

#

can u just help me

golden hornet
#

That's ok, I'm just trying to get a sense of what you know and don't know

austere valve
#

Okay

golden hornet
#

Do you understand what indentation is in python?

austere valve
#

Nope not really

#

sorry

golden hornet
#

Where have you been learning from?

austere valve
#

a tutorial but i also do some stuff on my own then see if they are correct

#

in the tutorial

golden hornet
#

indentation is the spacing at the start of a line

#

python uses it to determine what logic block your code is part of

minor steeple
#

already fixed this person's error a couple of days ago in here.. they're probably a bot.. same error.. same line number.. same script

austere valve
#

WHAT

#

im not a bot?

golden hornet
#
def func():
    print("This is inside the function")
print("This is not inside the function")
austere valve
#

Test me any way bro

#

Bots dont have tags they dont have bios

#

Bots do NOT talk like me

#

gng

austere valve
#

Yeah but i dont know what i should do with the second print u put do i just not put it?

golden hornet
#

In my example, how would you make the 2nd print as part of the function?

austere valve
#

i wouldnt. Since yeah mb for being really annoying since i dont know mostly anything so sorry if u want u can go ahead and leave this thread, But yeah i would just not put it tbh

#

this is my first time trying coding so

golden hornet
#

You're not being annoying at all

#

but I'm trying to get you to think about what's in front of you

#

we don't hand out the answer here directly

#

you won't learn anything that way

austere valve
#

yeah ik

golden hornet
#

@austere valve still there?

eternal oreBOT
#
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.