#đź”’ C

122 messages · Page 1 of 1 (latest)

sleek creek
#

F

ashen spruceBOT
#

@sleek creek

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.

sleek creek
#

Ai is saying this is wrong

south nexus
sleek creek
#

Yeah

south nexus
#

You shouldn't need AI to tell you this. It's already underlined in the code

sleek creek
#

The error messages are hard to understand

south nexus
#

What does it say?

sleek creek
#

I’ll have to open my pc and check but to prevent me using ai for debugging

#

Would u explain me the different types of errors

south nexus
#

In the beginning, I would recommend asking here or googling if you have a specific error. Odds are, you're not the first person to run into that problem, and there's almost always an explanation of what went wrong

#

If there's a word in your error that you don't understand, then you can do a bit of research as well to try and learn what it means

#

you likely ran into a NameError in your code above

#

which is when you try and use a variable that has yet to be assigned

#

!e

print(x)
ashen spruceBOT
# south nexus !e ```py print(x) ```

:x: Your 3.14 eval job has completed with return code 1.

001 | Traceback (most recent call last):
002 |   File "/home/main.py", line 1, in <module>
003 |     print(x)
004 |           ^
005 | NameError: name 'x' is not defined
sleek creek
#

So whenever I get that error you’re telling about, I always need to check that case?

#

That applies to other Python errors too and its cases

#

Correct?

south nexus
#

you will eventually see them enough times that you become familiar and can debug it yourself without looking it up

#

"what the error means" and "why your code caused it" can be two different things to work out

#

NameError means you didn't assign a variable. You thought you did, so you need to understand that trying to use == here does not work to assign a variable

nimble spoke
#

Also, if you're new to python I recommend not using AI, it makes you think much less

nimble spoke
sleek creek
#

It explains me the code

#

Then I try to do it myself

nimble spoke
#

!learn

ashen spruceBOT
#
Go-to beginner resources

Here are the top free resources we recommend for people who are new to programming:

For a full, curated list of educational resources we recommend, please see our resources page!

nimble spoke
#

I recommend using the Python progamming MOOC 2026

nimble spoke
sleek creek
nimble spoke
sleek creek
#

Because i use ai to save time when i tried the problem my self and i cannot do anything else

nimble spoke
#

Is it saving time tho?

#

In my opinion it's not

#

It's just another way to "cheat" your way into solving the problem

nimble spoke
#

From my experience, the best thing you can do is actually sit and "break your head" on these type of problems

#

because that's when you actually learn

nimble spoke
sleek creek
#

But if I do enough problems and when I do get stuck I could use ai to debug but I’ll still be able to increase my toolset

nimble spoke
#

Let me give you a scenario

#

Whenever you get stuck you use AI to debug

#

you keep on doing that

#

but then you stumble upon a problem that AI doesn't manage to solve

#

What will you do now?

#

All the "toolset" you know is using AI to solve the problems

sleek creek
#

My course is not advanced so it should be able to

#

Not very advanced

nimble spoke
#

That's not the point..

#

If you'll use AI now, you won't acquire the skills necessary for debugging bigger problems in the future.

sleek creek
#

So what should I be doing instead

nimble spoke
#

You mean, how do you solve problems when you're stuck?

sleek creek
#

Yes

nimble spoke
#

Well, you could start by googling your errors

#

In your case it would've solved it

#

Another thing you could do, is open the python documentation

#

Another thing is actually debugging and viewing what happens in the code

sleek creek
#

Fair point

#

@nimble spoke well can I send the task here I’m a bit stuck

nimble spoke
#

Where's your code?

#

It seems to be relying on other code

sleek creek
#

And I did this much but I don’t think everything is right yet

nimble spoke
#

Please send your code as text and not as images

#

you can wrap it in three ` from both sides to make it pretty

#

!code

ashen spruceBOT
#
Formatting code on Discord

Here's how to format Python code on Discord:

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

These are backticks, not quotes. Check this out if you can't find the backtick key.

For long code samples, you can use our pastebin.

sleek creek
#

👍

#

and the given data

nimble spoke
#

Where is the preferences form?

sleek creek
#

It should be in the code

nimble spoke
#

is it your_restaurants?

sleek creek
#

No

sleek creek
#

There is a form

nimble spoke
#

If it's not the your_restaurants endpoint then I can't seem to find it.

sleek creek
nimble spoke
#

It is your_restaurants...

sleek creek
#

Yes

#

That’s the filtered

nimble spoke
#

Alright

sleek creek
#

Because u said form but that’s not a form

#

Its results page in other words

#

But yea

nimble spoke
#

Alright

#

Now that I understand, what's the issue?

#

I see you haven't printed the matching restaraunts

sleek creek
nimble spoke
#

What's stopping you? Elaborate

nimble spoke
#

Correct, Fashoomp already helped you with that didn't he?

#

Or did you not understand

sleek creek
#

He only asked if I know the difference between = and ==

#

and I know that

nimble spoke
#

Ok, so what's the differnece between them?

sleek creek
#

Just guide me how to complete this exercise and point my mistakes

sleek creek
#

Assigning and the other is checking if the other is if they are equal

nimble spoke
#

Okay, and what did you use in the line price == False

sleek creek
#

If price is equal to false?

nimble spoke
#

Yep

sleek creek
#

Even with options = false?

#

Why didn’t u mention that

nimble spoke
#

Because here you use one = sign

#

it's assigning it false

#

which is a legitimate syntax

sleek creek
#

Ohhhh

#

then

#

what do I do next

nimble spoke
ashen spruceBOT
#
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.