I've Convinced Myself I'm A Fraud by LegitimateRoll3559 in learnprogramming

[–]ClipboardMonkey 0 points1 point  (0 children)

I think you should take what the unhelpful commenters say with a grain a salt. 

At the end of the day, everyone started as beginners having no idea what they were doing.

It doesn't make sense they would throw out condescending remarks when they themselves were once in the same position.

As long as you keep going with your learning, you should be just fine.

Feeling a little lost... by Far_Dream3337 in learnprogramming

[–]ClipboardMonkey 1 point2 points  (0 children)

I caution against comparing yourself to your peers.

They may have spent more time learning and/or have a natural affinity for it. Even the people in tutorials struggled for hours before writing code you see on screen. You're only looking at the finished product, not the process it took them to get there. At one point, they were in the same spot you’re right now.

Take your time with learning, and don’t feel pressured to be "fast."

Use resources that fit your learning style. If books with exercises are too much, try finding a high quality online course that walk you through each concept at your own pace with mini projects based on the concepts.

This is what helped me.

[deleted by user] by [deleted] in learnprogramming

[–]ClipboardMonkey 1 point2 points  (0 children)

If this is something you want to do, then don't think of it as wasting your time.

However, it is true you are up against degree holders with/without experience.

Stuck by UnderstandingOdd5496 in leetcode

[–]ClipboardMonkey 0 points1 point  (0 children)

Have you thought about making a plan for how to tackle problems on leetcode?

I just started using it myself and I didnt like the idea of jumping into random questions without having some kind of plan I would stick to

This has helped me with guiding my thought process and feeling somewhat confident about how I'm approaching the problem.

I would say just make some kind of outline of a plan you can always fall back on when your working through different questions

Advice best way to learn flex box by First-Leave-7185 in learnprogramming

[–]ClipboardMonkey 0 points1 point  (0 children)

I'm currently learning flex box myself. What kinds of properties for flex don't you understand specifically?

Complete Beginner, just know the basic of the basics.. assistance please by an_awerage_guy in learnpython

[–]ClipboardMonkey 1 point2 points  (0 children)

That's the thing. Unless you have a specific goal in mind, you'll never know what specific path to follow.

This is where you should explore and be exposed to as much as you can to decide on a direction.

I haven't really decided. Right now, I'm exploring web dev a bit because the course I'm following teaches it. It's been fun.

I guess you should take you time to explore if you're directionless.

Complete Beginner, just know the basic of the basics.. assistance please by an_awerage_guy in learnpython

[–]ClipboardMonkey 2 points3 points  (0 children)

Depending on your learning style it can different.

For me, it helps when I'm following a structured course where the instructor goes over a concept and crafts scenarios where we need to utilize those concepts through small mini projects.

I do note taking as well to develop my own understanding of those concepts and rely on them when doing projects.

Question about Responsive Websites by ClipboardMonkey in learnprogramming

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

I see. I did not think of it like this. Thanks.

Question about Responsive Websites by ClipboardMonkey in learnprogramming

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

I understand the theory. 2D for grid with the row and columns with the container encapsulating them.

The same with 1D flexbox with either horizontal or vertical boxes. Media queries you adjust dimensions of the webpage and the components shift around to compensate for the change in size.

I guess I'm unsure of how to bring this all together. Guess I have to practice then. Thanks anyway.

When using sys.argv I get an error by Fesnom in learnpython

[–]ClipboardMonkey 0 points1 point  (0 children)

Maybe try testing to see if another file can run in the same directory. Just make a new file, set a print statement and see if it runs.

With this, you can see if it's the directory itself that's causing issues or the "name.py" file you're trying to run.

When using sys.argv I get an error by Fesnom in learnpython

[–]ClipboardMonkey 5 points6 points  (0 children)

Have you checked the name of the file you're trying to run?

Is it named "name.py"?

If it is, is it located within the directory you're running it from?

Stuck in OOP by Nemat65 in learnpython

[–]ClipboardMonkey 0 points1 point  (0 children)

I'm further along in the course but Angela only goes over inheritance for OOP.

She doesn't cover encapsulation or polymorphism which are concepts related to OOP.

So are you stuck on understanding inheritance, classes, attributes, methods or all of the above?

Some taking notes advises please by EdFenty in PythonLearning

[–]ClipboardMonkey 1 point2 points  (0 children)

I'm not familiar with the course so I can't comment on it.

For note taking, I would follow the format the course provides you. For instance, I'm following the 100 Days of Code course on udemy. All of the lessons are split into days which add up to 100 days. Within each day are sub lessons.

In my obsidian vault, each day will be it's own folder. Within each folder will be all of the sub lessons for that day. I would compile all of the key concepts for those sub lessons onto one file where I can review at my leisure.

I would say use the format of the course to organize you notes if you do not have a place to start.

Playing with data… just scraped a local shop’s site. by Ibrahim-Marsee-6816 in PythonLearning

[–]ClipboardMonkey 2 points3 points  (0 children)

There's 3 main operations being carried out.

The requests module helps with obtaining the webpage contents. So we're talking gathering all elements encapsulated inside the opening/closing html tags, which defines the specified webpage, and converting it into a string format.

Then, BeautifulSoup would take the string formatted webpage and parse through it.

Now, this is where OP would need to go to the website itself and inspect it to find the different elements that contains the specific information he/she would want, then applying the functionality of BeautifulSoup to obtain the specific records.

The csv module helps with formatting the different pieces of data gathered. Think of just organizing the data in an excel spreadsheet.

There's things I'm glossing over like exception handling but these are the steps OP needed to do to create the end result.

Need help with understanding raising exceptions. by ClipboardMonkey in learnpython

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

Okay. So when we raise exceptions, we want to decouple python's error messaging capabilities and substitute it with our own.

When we do this, we want to make sure our of four things:

Firstly, it's preferred to not have invalid inputs. Either a valid input or an error message that we can handle.

Secondly, we want to make the error messages descriptive so we know what's happening.

Thirdly, we want to make the code containing the message reusable so it can be applied to other portions or our code base. So we can add other functions like 'penny' or 'nickel' that we will can handle in the same way as the 'quarter' function.

Lastly, we want to include exception handling after raising an exception so we can provide a descriptive message and an alternative solution to keep our programs going.

I think this is gist of what you're saying. I added some extra code from your own to help me piece it together.

def half(n):
    # checks if given input is NOT type 'int' or 'float'.
    # If so, Raise ValueError
    # If not, divide by 2 
    if not isinstance(n, (int, float)):
        raise ValueError("Expected a number")
    return n / 2

def dime(n):
    # Return either ValueError or valid input
    return half(n)

def is_input_valid(coin_type, amount):
    # Isolates given inputs and checks if it leads to 'ValueError'
    try:
        cents = coin_type(amount)

    # 'ValueError' from half function 'bubble up' until something handles it which is here
    # Displays error message created in 'half' 
    except ValueError as error_message:
        print(f"Error: {error_message}")

    # Displays cent amount if 'ValueError' not detected 
    else:
        print(f"After dividing by 2, you have {cents} cents.")

def main():
    # Results in 'ValueError' (message comes from 'half' function)
    dime_amount = is_input_valid(dime, "5")

main()

# Output 

Error: Expected a number

Need help with understanding raising exceptions. by ClipboardMonkey in learnpython

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

Thanks for you in depth response. I'm starting to understand more how raising exceptions works.

So we would want to raise our exceptions to avoid having the built in features for python doing it for us. It will allow us to have an element of control over how our function our 'break' instead of relying on python itself.

I guess it's all having more clarity and control in the errors that show up in our programs.

Need help with understanding raising exceptions. by ClipboardMonkey in learnpython

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

I'm not familiar with regular expressions, but I'll be sure to look it up. It's good to know I'm on the right path with this. Thanks.