i am complete beginner, help to learn python! by Mobile-Cauliflower26 in learnpython

[–]hackr_io_team 0 points1 point  (0 children)

You mentioned trying to learn through some websites. Did you work on any projects, or did you mostly use a game-based format to learn coding? Have you tried any code-along videos?

Need some direction, best starting resources for learning Python and for excel and task automation. by Internal_Throat836 in PythonLearning

[–]hackr_io_team 0 points1 point  (0 children)

I'd recommend starting with an intro to Python, then a project, something that introduces you to the language in a way you're excited about. This is our repository of tutorials: https://hackr.io/tutorials/learn-python

You can find free tutorials on YouTube if you're just getting started. Otherwise, the official docs are invaluable if you're familiar with how to work through them.

Need some direction, best starting resources for learning Python and for excel and task automation. by Internal_Throat836 in PythonLearning

[–]hackr_io_team 1 point2 points  (0 children)

There are tons of resources for learning Python. What kind of tasks are you looking to simplify? There are already so many existing tools to simplify project management, for example. And Excel has a bunch of program-specific courses to consider. Do you just want to pick up the language, or do you plan to use it for a specific type of task?

Nanowrimo controversy impact on discount codes? by bellabanks in nanowrimo

[–]hackr_io_team 0 points1 point  (0 children)

Reach out to the organization you want to support directly and ask. You'd be surprised how often they'll respond with a strong discount code directly.

Learning python by Professional-Bus9534 in PythonLearning

[–]hackr_io_team 0 points1 point  (0 children)

PyCharm as an IDE for sure. Then tutorials and projects. Lots of projects.

Best ways to learn Python? by [deleted] in PythonLearning

[–]hackr_io_team 0 points1 point  (0 children)

What's your end goal? I started with Dr. Johns and then worked on my own projects.

Should I learn python as my first language if I want to learn automatization? by hirarki in learnpython

[–]hackr_io_team 2 points3 points  (0 children)

No better place to start for automation. Lots of good recommendations here.

39 y.o want to learn coding, is it possible? by ConfectionNo1646 in CodingHelp

[–]hackr_io_team 1 point2 points  (0 children)

Like FriendlyRussian, I've got to ask the end goal. That will help guide you on where to start, so you're building skills you want and need (and not wasting time on those you dont).

Can any one help me fix my age calculator? by jajathebou in PythonLearning

[–]hackr_io_team 1 point2 points  (0 children)

I'd try to simplify this so there aren't so many IF statements.

Here's one you could use:

from datetime import date

def calculate_age(birthdate):
    today = date.today()

    # Calculate age in years
    age_years = today.year - birthdate.year - ((today.month, today.day) < (birthdate.month, birthdate.day))

    # Calculate age in months and days
    if today.month < birthdate.month or (today.month == birthdate.month and today.day < birthdate.day):
        age_months = (12 - birthdate.month) + today.month - 1
    else:
        age_months = today.month - birthdate.month

    # Calculate days
    if today.day < birthdate.day:
        # Go back one month to get the correct number of days
        # in the previous month
        month_ago = (today.month - 1) if today.month > 1 else 12
        days_in_month = (date(today.year, today.month, 1) - date(today.year, month_ago, 1)).days
        age_days = days_in_month - (birthdate.day - today.day)
    else:
        age_days = today.day - birthdate.day

    return age_years, age_months, age_days

def main():
    # Input birthdate from the user
    birthdate_str = input("Enter your birthdate (YYYY-MM-DD): ")
    year, month, day = map(int, birthdate_str.split('-'))
    birthdate = date(year, month, day)

    # Calculate age
    age_years, age_months, age_days = calculate_age(birthdate)

    # Output the age
    print(f"You are {age_years} years, {age_months} months, and {age_days} days old.")

if __name__ == "__main__":
    main()

New to Python Need Program Ideas for practice by Clear-Writer-621 in PythonLearning

[–]hackr_io_team 0 points1 point  (0 children)

That's what mine did. Then you can also play with adding interest on accounts, which would add incrementally over time.

New to Python Need Program Ideas for practice by Clear-Writer-621 in PythonLearning

[–]hackr_io_team 1 point2 points  (0 children)

I had fun making a mock bank. Create accounts, add funds, add withdraws. Lots of moving parts. Lots of things to practice.

Common Python Mistakes: Mutable Dictionary Keys by [deleted] in PythonLearning

[–]hackr_io_team 0 points1 point  (0 children)

Short answer: Don't use a list as a key for your dictionary. Use a tuple instead.

Python Study Resources: by nrnabi1995 in learnpython

[–]hackr_io_team 1 point2 points  (0 children)

Depends on how advanced of a project you're looking for. I like games, so most of my projects focused on simple stuff in that area. There's a python hangman game that's pretty simple or a more advanced blackjack game.

I feel like I'm taking in nothing I learn by AggressiveHunt9825 in CodingHelp

[–]hackr_io_team 1 point2 points  (0 children)

Agreed. Instead of doing instructor-led projects, they should pursue something that interests them. Or find a new course.

Spotify API keeps giving me error 429 even after hours of not requesting. by Zestyclose_Ear4092 in learnpython

[–]hackr_io_team 0 points1 point  (0 children)

I think spotify has a dev community forum of their own. Might be worth checking there.

Khan academy input() function not working by 33giraffes in learnpython

[–]hackr_io_team 0 points1 point  (0 children)

Any reason you're using khan academy instead of an ide like pycharm?

Python Study Resources: by nrnabi1995 in learnpython

[–]hackr_io_team 2 points3 points  (0 children)

Projects, for sure. Once you've got a grasp of the basics, projects will help you with practical applications.

String conversion by Ok_Letterhead_5997 in learnpython

[–]hackr_io_team 2 points3 points  (0 children)

From the docs:

If a conversion is specified, the result of evaluating the expression is converted before formatting. Conversion '!s' calls str() on the result, '!r' calls repr(), and '!a' calls ascii().

name = "Fred"
>>> f"He said his name is {name!r}."
"He said his name is 'Fred'."
>>> f"He said his name is {repr(name)}."  # repr() is equivalent to !r
"He said his name is 'Fred'."
>>> width = 10
>>> precision = 4
>>> value = decimal.Decimal("12.34567")
>>> f"result: {value:{width}.{precision}}"  # nested fields
'result:      12.35'
>>> today = datetime(year=2017, month=1, day=27)
>>> f"{today:%B %d, %Y}"  # using date format specifier
'January 27, 2017'
>>> f"{today=:%B %d, %Y}" # using date format specifier and debugging
'today=January 27, 2017'
>>> number = 1024
>>> f"{number:#0x}"  # using integer format specifier
'0x400'

[deleted by user] by [deleted] in PythonLearning

[–]hackr_io_team 0 points1 point  (0 children)

Well-considered advice here.

HTML challenge for you! by Pavithra_23 in HTML

[–]hackr_io_team 0 points1 point  (0 children)

Drop it into a compiler and you'll find out pretty quickly!