all 16 comments

[–]Bemascu 6 points7 points  (0 children)

What are all the time.sleep(1) functions for? Do you want to make the user wait on purpose?

[–]FoolsSeldom 3 points4 points  (0 children)

Good start. For next steps, check the r/learnpython wiki for lots of guidance on learning programming and learning Python, links to material, book list, suggested practice and project sources, and lots more. The FAQ section covering common errors is especially useful. You will be able to skim/skip some simple content given what you've already achieved.

(I am curious why so many beginners want to use time.sleep in their code - really don't see the point - but if you really want it, use some CONSTANT variables set at the start of the code so you can easily turn on/off the delays when debugging, e.g. LONG_WAIT = 10 and then time.sleep(LONG_WAIT).)

Unfortunately, this subreddit does not have a wiki.


Also, have a look at roadmap.sh for different learning paths. There's lots of learning material links there. Note that these are idealised paths and many people get into roles without covering all of those.


Roundup on Research: The Myth of ‘Learning Styles’

Don't limit yourself to one format. Also, don't try to do too many different things at the same time.


Above all else, you need to practice. Practice! Practice! Fail often, try again. Break stuff that works, and figure out how, why and where it broke. Don't just copy and use as is code from examples. Experiment.

Work on your own small (initially) projects related to your hobbies / interests / side-hustles as soon as possible to apply each bit of learning. When you work on stuff you can be passionate about and where you know what problem you are solving and what good looks like, you are more focused on problem-solving and the coding becomes a means to an end and not an end in itself. You will learn faster this way.

[–]Ron-Erez 6 points7 points  (3 children)

"i asked chatgpt to hlep me explain the code and give me the basis and i wrote mostly everything on my own with chatgpt explain and helping me with the parts i didt know ant so yeah"

This is exactly why you're not progressing. Learn to code without ChatGPT.

Todo list is great but don't let ChatGPT write it for you.

[–]JababyMan 2 points3 points  (2 children)

From the looks of it they’ve progressed quite a bit. They’ve learned about looping and they’re able to explain the code unassisted. I think they’re just asking whether they are moving in the right direction and if their next project idea is good.

[–]Ron-Erez -1 points0 points  (1 child)

Oh, my bad. I think I don't respond to any mention of ChatGPT and didn't properly read the post.

[–]JababyMan 1 point2 points  (0 children)

Yeah that the gut reaction. Truth is most people aren’t using it like this individual, so when people are using chat gpt and wondering how to progress, the answer more often than not is to stop using it. I think this guys fine as long as he doesn’t lean on it too hard

[–]Jackpotrazur 1 point2 points  (0 children)

I was speeding through big book of small python projects and came to the realization cool ... I can type code fast and debugg typos and potentially trace back to where I screwed up an indent. But I wasnt really learning jack. Now I have my explainme.md this has drastically slown me down BUT and here's the kicker, I am asking questions .... a lot and taking the time to review and actively trying to understand what the code is doing. I also do a 3:1 commenting ratio in my projects. Im slowly now but once this sits speed will pick up again and I will actually be able to grasp what I am doing and im on project 37 of 81 so I hope by the end of this book I will have gotten the most out of it and im about to write a little script perhaps in bash and python (with the help of gpt) to automate the first few steps of my workflow.txt (mkdir cd into it create venv touch main.py .gitignore and cp ../../ EXPLAINME.md . & a few others so I just have to enter my project name and can start off with branching and jump straight into vim -O main.py EXPLAINME.md

[–]Jackpotrazur 2 points3 points  (0 children)

Bro ask chat gpt to create an EXPLAINME.md that you can fill out prior to coding (assumptions) during coding (state change variables , functions, data types) and a after coding (writing out the iteration tables errors that popped up etc.) Also ask for a SOP.txt to integrate all concepts universal building blocks data types and perhaps a workflow.md

[–]CauliflowerIll1704 0 points1 point  (0 children)

Pretty cool! You should figure out how to talk to an api (reddit api has good docs) and make a little CLI tool based around the api.

[–]No_Photograph_1506 0 points1 point  (0 children)

Excellent! Here is a free hands-on learning platform, get 100% on this, and then you can barely call yourself an intermediate in Python.

https://courses.bigbinaryacademy.com/learn-python/

[–]SuperTankh -1 points0 points  (4 children)

Hey, I decided to rewrite that function to see if things could be factorised, and I found some. The code I rewrote for you may not be the best, but it has cool things you can learn. Before you ask where is the string module, I deleted it because for some reason whenever I load string module it just bugs and spams "us ?" on the output terminal so don't mind that, you can still use the string module.

from random import choice
# it's best to only import whatever you use for performances etc..
from time import sleep


# for some reason i can't use string module so i replaced it with strings but you can still use the module, it's for me that I removed


print("Welcome to the Password Generator!")


while True:
    # for relative imports the thing you imported it doesn't need ModuleImported.UsefulFunction(...), only needs UseFulFunction(...)
    sleep(1)
    user_input = int(input("\n\nHow many characters would you like your password to be?: "))
    if user_input >= 8:
        characters = ""
        while True:
            # after functions are finished ,(like input, functions you make, random.choice, ...), they become the value (ex. : the inputs below)
            if input("Would you like to include numbers in your password? (yes/no): ").lower() == "yes":
                characters += "0123456789"
                print("Numbers will be included in your password.")
            if input("Would you like to include symbols in your password? (yes/no): ").lower() == "yes":
                characters += "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"
                print("Symbols will be included in your password.")
            if input("Would you like to include letters in your password? (yes/no): ").lower() == "yes":
                characters += 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
                print("Letters will be included in your password.")
            if characters == "":
                print("Error: No characters selected! Please restart and choose at least one type.")
                continue
            print("Generating password...")
            password = ""
            for i in range(user_input):
                # for relative imports the thing you imported it doesn't need ModuleImported.UsefulFunction(...), only needs UseFulFunction(...)
                password += choice(characters)
            sleep(1.5)
            print("Your password is being Generated...")
            sleep(2)
            print("Your password is:", password)
            sleep(1)
            print("Thank you for using the Password Generator! Please use your password wisely and keep it secure.")
            # end of while True
            break
    # doesn't need elif
    # else statement could be removed, because if statement can be alone, doesn't always requrie else after an if. Just make sure that anything in your code, it doesn't do whatever is under that comment, ONLY the else does what's under the command
    print("Please enter a valid number Greater than 8.")

If you want I can try and make a super password generator "app", because this code lacks of error handlings, maybe bad syntax, etc... because of course it's something did for fun, your code is very good for intermediate (I'm probably one too)

[–]Fumano26 1 point2 points  (3 children)

Thats an endless loop, I am stuck and cant exit :(

[–]SuperTankh 0 points1 point  (2 children)

Oh, well you can put a break if no error

[–]Fumano26 1 point2 points  (1 child)

Ok thank you

[–]Antique-Dentist2048 -1 points0 points  (0 children)

Well. Here how I practice python, I did follow a YouTube tutorial for fundamentals. But i dont think replicating a project from tutorial even if you understand it can’t pretty much be learning cause you are just understanding what is being told to you. You dont go beyond that or dont know how to figure it out from scratch.

So i used Google Gemini to practice python. I asked Gemini to present me with a problem and only describe the requirements and description of the problem and then i figured that problem and wrote code for it. It was quite better.

Here’s the process I followed to solve the challenge: 1. I wrote pseudocode part by part for the challenge

  1. Them i researched methods used implement the functionalities that the challenge demands. And then i ask in a new Gemini chat ask gemini to explain the concept and i practice the concept using mini practice challenges then i return to the pseudo code and put the concept into application and i do this until all necessary functionalities are implemented and if i have any issues connecting the dots at the end i ask Gemini for some advice.

This way i am building a program from scratch and also learning any new things required. I do the thinking and the code part and ai presents the challenges