r/CodingForBeginners • • Oct 21 '26

Baby Steps, second day learning Python

Post image

Day two learning Python. Combining Print commands with Variables.

107 Upvotes

21 comments sorted by

5

u/kutac56 Oct 21 '26

Small nitpick but I recommend doing x = y instead of x=y as it looks better

4

u/fyknite Oct 21 '26

Space between assign sign. πŸ‘ŒπŸ»

2

u/DiscountFit9224 Oct 21 '26

install black package and black formatter extension then turn on format on save in settings

2

u/fyknite Oct 21 '26
robot_name = "CyberPunk"
robot_health = 100
robot_coins = 25
robot_coins += 15
robot_health -= 20
robot_coins += 30
print(robot_name)
print(robot_health)
print(robot_coins)

2

u/AffectionatePlane598 Oct 23 '26

The best part of programming is learning stuff for the first time and finishing your first big project keep pushing

1

u/Practical-Bug-6786 6d ago

I agree, it looks better with the spaces.

4

u/xarop_pa_toss Oct 24 '26

Very nice! Here's a tip that you will use forever... Use the debugger. Click on one of the lines to the left of the line numbers and a red ball πŸ”΄ should show up. This is called a breakpoint.

Then start the program in debug mode (probably F5 but there's a button there on the left saying Run and Debug too) and the program will pause when it hits that line. A new panel should appear showing you the Immediate variable values! You can change these while the program is paused!!!

Try this:

  • put a breakpoint on line 4
  • on the variables viewer that shows up, try changing the value of player_name to something else.
  • then keep running the program line by line

:D you will use the debugger forever. When you get comfortable with it you realize that there is no guessing in programming. You can always just stop on a line, and view and manipulate most things in that scope. It also let's you execute lines of code inside your program on another panel that shows up, all while your program is paused which is so cool

1

u/Odd-Statement-5676 Oct 21 '26

How you practice python after learning any specific topic?? Mini projects or you are also doing questions from leetcode and hackerrank

1

u/fyknite 16d ago

I’m trying to do mini projects. The idea is to accomplish something real in a month. I remember things a lot better if I apply them with a purpose.

1

u/_U5eless 16d ago edited 16d ago

tf man all that expensive macbook for writing this shit????

1

u/fyknite 16d ago

Second day πŸ€¦πŸ»β€β™‚οΈ learning python 🐍. I use my semi expensive MacBook to do some more intensive things. I promise you that. Lol

2

u/ActuaryDear8234 Oct 21 '26

Great work!! It’s fun, isn’t it? I miss my days doing the same kinds of stuff in python

2

u/Practical-Bug-6786 6d ago

You could make this into a RPG word games!

0

u/BleedReddit Oct 21 '26 edited Oct 21 '26

yup, learn to crawl before you learn to walk. Make sure to understand the class concept and how to create them, after you learn functions and function helpers.

-3

u/ItsPandor Oct 21 '26

Use PyCharm instead of microslop's code editor. It's way better

3

u/NotSeacombe Oct 22 '26

incredibly silly advice for someone who is at the point of writing print statements

2

u/kutac56 Oct 21 '26

Code editor doesn't matter that much. I hate microslop a lot, but when starting out programming vs code is fine. I don't think it should be used once you are very good at it though. I think vim keybinds text editors are better. I used to use neovim but now I use doom emacs

1

u/NotSeacombe Oct 22 '26

i have worked in software dev in a few different companies for 10 years and every single engineer i've worked with uses VSCode as their IDE

1

u/kutac56 Oct 22 '26

It's all just an opinion anyway

1

u/xarop_pa_toss Oct 24 '26

Nah use Thonny because Pycharm is bloated. Nah use Notepad++ because Thonny is bloated. Nah use nvim because why use anything outside of the terminal.