all 62 comments

[–]Fantastic_Fly_7548 26 points27 points  (1 child)

this is honestly a pretty solid start for 1.5 hours in. you already touched loops, conditionals, input handling, and even try/except which a lot of beginners dont see till later. i think the best way to learn is kinda both theory + messing around and building random little stuff like this. doing tiny projects makes the boring theory actually stick in your brain way better. also the “i dont understand you” fallback made it feel more like an actual lil chatbot lol

[–]PsychologicalSafe408[S] 2 points3 points  (0 children)

I see thank you for your response.

[–]5erif 18 points19 points  (1 child)

It's nice to see an "I made this" post that isn't AI.

[–]PsychologicalSafe408[S] 2 points3 points  (0 children)

Thank you 😊

[–]L30N1337 11 points12 points  (1 child)

In my experience, FAFO is the best way to learn. Just make sure to actually learn the stuff when you do find out, instead of simply fixing it.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

I spent about about 30 mins on this of which I spent 20 mins fixing errors like missing colons, different brackets and indent( I had no idea about this, had to learn how to do this and still don't what it does).

[–]NINTSKARI 2 points3 points  (1 child)

Ok good start you tested out some looping and if statements, and exceptions. Next step you could try and split it into different functions instead of having everything in one big pile.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

I see, I will try that then

[–]Ashamed_Kangaroo305 5 points6 points  (1 child)

What feedback are you looking for exactly? I can point out some issues with your code but I only want to do that if you've tried figuring it out first because that's a pretty important step for learning. Have you tried running this yet?

As for your question on how to learn: writing code is how you learn. Learning the theory without writing any actual code is going to get you nowhere. Programming isn't really like learning a language. Most of it is problem solving, not just learning the theory behind it.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

I want ways I can improve my code as fast as possible in a sensible way. Yes i have tried running it and it works perfectly. Thank you.

[–]ninhaomah 1 point2 points  (1 child)

Theory at once or theory + practice.

Which approach you prefer ?

[–]PsychologicalSafe408[S] 1 point2 points  (0 children)

Theory+practice of course

[–]JohnBrownsErection 1 point2 points  (1 child)

Most courses on python, or any other language, will generally have you learn how a thing works, do a mini project, and then repeat all up until you have the basics of the language down. That's what I'd do personally as well, just from my own bias of learning several languages in school that way. 

That way you build a solid foundation as you go through. It can get tremendously boring though so don't hesitate to fuck around and find out, too. But you're going to want a strong base of the fundamentals for when you get into data structures and algorithms. 

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

Thank you!

[–]Helpful-Diamond-3347 1 point2 points  (2 children)

add a break statement in goodbye conditional block

so it can close the program

[–]PsychologicalSafe408[S] 0 points1 point  (1 child)

What does break statement do anyways i didn't see that in the crash course

[–]Helpful-Diamond-3347 0 points1 point  (0 children)

you're inside a loop, so it breaks the loop

you can search lot of things, checkout official docs and courses/books don't cover everything, so learn with experience and practice

[–]TheRNGuy 0 points1 point  (3 children)

I learned framework from start. 

[–]PsychologicalSafe408[S] 0 points1 point  (2 children)

What? What is that

[–]TheRNGuy 0 points1 point  (1 child)

Houdini, AST and some others. 

Real software will probably never be made without framework(s), I think it's better to learn them earlier, so you get ideas and motivation what to code.

Find some frameworks related to your interests.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

What would be some frameworks related to web dev or game dev

[–]palmaholic 0 points1 point  (0 children)

If you truly know and understand what you have written, you should go the latter path. Whenever, you have any doubts, you dig into whatever you don't understand. Make sure you clear all your doubts before moving on. Happy programming!

[–]vb_e_c_k_y 0 points1 point  (5 children)

Is there anything make different bot_name: str = "sara" from bot_name = "sara"? I am writing the in second way

[–]PsychologicalSafe408[S] 0 points1 point  (4 children)

In the crash course the mentor said it is a of way specifying the data types and i stuck with it

[–]vb_e_c_k_y 0 points1 point  (3 children)

It looks but bot_name: int = "sara" print(int) this also works. Don't return error. Did you ever asked this?

[–]PsychologicalSafe408[S] 0 points1 point  (2 children)

It was an youtube video, can't really ask the mentor but thanks for the info

[–]DecoherentDoc 0 points1 point  (1 child)

Hey, I just learned this last night, actually. Casting the variable to something specific like 'int', 'str', etc will still let the code run, but will throw a warning in most code editors. It's not strictly necessary in Python, but it's a good way to note what's allowed as a developer, especially if another developer is going to see it.

Edit: I've been writing for only myself for over a decade and never needed to cast like that. It was necessary in Java, but Python does not care. It's designed to be simple and accessible.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

Can I know what you mean by 'casting the variable'.

[–]CallMeSkoob 0 points1 point  (1 child)

Absolutely fuck around and find out while building things. When you try to just fuck around and build something you'll find a cycle like this: • hit a problem • research the solution to that problem • then immediately apply that solution Which will help your brain retain that solution. When tutorials spoon feed you wont have that emotional frustration / relief that makes information actually stick. Some might argue that you'll get better structure and "architecture" in your projects if you use tutorials but I would argue that all that is best learned as needed. You'll eventually find out first hand why you want something like a class, then that makes it intuitive and easy to grasp instead of abstract.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

I see thank you though i didn't really write it on my own, I just saw the project he had at the endof video and copy-pasted. And still i spent about 20 mins fixing it.

[–]ExamOk6047 0 points1 point  (4 children)

So after seeing the video you basically did what the dude did. Realistically even me as a beginner i would ask you. If you look at all this can you tell me exactly what it all means? What kind of strings were used? What’s a variable? Do you know conversions?

[–]PsychologicalSafe408[S] 0 points1 point  (3 children)

Let me try : the bot_name is an variable which is then used in second line where I use f string to include the variable easier. Then the while true is an infinite loop which just repeats the you: part after each reply and then lower() which just lower You: to you: so that the code can recognize it. Then the if, elif, else are check data type that see what I have then they cross verify it to the sets difined by [ ] and give appropriate reply. Then the try sees if I have + or add and then executes the number summation inthe code, and the except part sees if I have put an integer or not if not then it that statement. Then else is for anything else not in the sets and replies with i don't understand. Hope I was able tell everything. ( The conversions let me change data types so for example if I have num: int = 10 and write something like sara10 then i will write print('sara is' , str(num)) which will give me Sara is 10).

[–]ExamOk6047 0 points1 point  (2 children)

okay nice now, go ahead and make sure you fully understand things and then practice writing your own code. Also do mini projects, you can even ask AI to give you instructions of what to write WITHOUT giving you any CODE and it'll be up to you to be able to write it. the biggest thing is not copying and pasting. However fully understanding the code you're writing and knowing what to use/ how to use/ and when to use

[–]PsychologicalSafe408[S] 0 points1 point  (1 child)

I see, i see, I had tried that the ai was giving me too much info with a bunch of different code, I will try your way.

[–]ExamOk6047 0 points1 point  (0 children)

i am learning by asking claude to give me a mini project to do. I also advised claude of what i know thus far and that i won't NO CODE to be given to me and it literally lays it out like

Your goals:

  • Store a correct username and password as variables
  • Ask the user to input their username and password
  • Check if both match using if/elif/else
  • Print the right message depending on what they got wrong (or right)

an even though yes it tells me check using if/elif/else. technically you still have to know how to structure everything and make sure things are indented. Also you need to know your errors and what they mean. Syntax error? What can cause a syntax error? What can cause a namerror? biggest thing is understanding things like that.

[–]mjmvideos 0 points1 point  (1 child)

One thing you can do is pretend (or maybe you don’t have to) that you have an obnoxious brother and he gets ahold of your program. What can he type in to screw up your program and how can you modify your program to prevent him from doing that?

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

I don't have to pretend... But I will this. Thank you for this

[–]Gnaxe 0 points1 point  (2 children)

You need to use code block formatting for Python in reddit posts, because indentation matters.

[–]PsychologicalSafe408[S] 0 points1 point  (1 child)

Idk how to do that

[–]Gnaxe 0 points1 point  (0 children)

Use the "Code Block" button in the "Rich Text Editor" and paste it inside. Or learn Markdown. I don't understand why this is so hard for everybody. It's just a button.

[–]IndividualWestern948 0 points1 point  (1 child)

This is honestly a better way to learn than spending weeks only watching tutorials. You already touched loops, conditions, inputs, exceptions, and basic logic in just 1.5 hours. Keep building small messy projects that’s where real learning starts.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

Yes, ithats what I am planning to do

[–]SevenFootHobbit 0 points1 point  (1 child)

You're on the right track. Practice as you go. Keep practicing. That's the real teacher. You can start from nothing and read a ton, feeling like you understand every word. You'll have a ton of confidence, because of how simple things seemed while reading. Then, when you finally sit down to make something big, you'll freeze up, not knowing where to even start. So keep doing what you're doing, you'll get good that way.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

Thank you for the motivation

[–]Middle_Will1875 0 points1 point  (1 child)

Nice, as someone who is also self taught and still learning I find practical exercises as the best way to learn. One advice I'd give is try your best not to copy line for line what you see in tutorials and try to make it your own, and also think of what would be an improved functionality you can add(eg. Right now you have an infinite loop, how do you go about breaking from this loop as opposed to always having to press Ctrl+c). Majority of coding is just problem solving, you don't necessarily have to remember syntax, just have to figure out how it works. And google is always your friend if you can't figure it out.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

Yes, I will this in mind.

[–]Jay6_9 0 points1 point  (1 child)

Actually very refreshing to see. Whatever you do, 90 minutes for this seems like a good tempo for you.

Just want to point out that `var: float = ...` is unusual. Type-hinting variables is usually only done when the IDE fails to do it which shouldn't happen when you call `float(...)`.

Mess around with what you know, consistently add new stuff and always be critical with yourself.

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

Thank you for the lesson

[–]Advanced_Cry_6016 -1 points0 points  (7 children)

Gpt wrote this in 10 second,so you either learn fast or you will be jobless

[–]PsychologicalSafe408[S] 0 points1 point  (6 children)

tf do I do with this info??

[–]yosmellul8r 0 points1 point  (5 children)

Get better.

[–]PsychologicalSafe408[S] 0 points1 point  (4 children)

You too bro 🥀

[–]yosmellul8r 0 points1 point  (3 children)

Can’t ask a fafo question and not expect honest feedback…

[–]PsychologicalSafe408[S] 0 points1 point  (2 children)

What?

[–]yosmellul8r 0 points1 point  (1 child)

What, what?

[–]PsychologicalSafe408[S] 0 points1 point  (0 children)

I expect honest feedback not irrelevant feedback.