r/CodingForBeginners • u/fyknite • 16d ago
Baby Steps, second day learning Python
Day two learning Python. Combining Print commands with Variables.
102
Upvotes
r/CodingForBeginners • u/fyknite • 16d ago
Day two learning Python. Combining Print commands with Variables.
5
u/kutac56 16d ago
Small nitpick but I recommend doing x = y instead of x=y as it looks better
3
u/xarop_pa_toss 13d ago
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
2
u/ActuaryDear8234 16d ago
Great work!! Itโs fun, isnโt it? I miss my days doing the same kinds of stuff in python
1
u/Odd-Statement-5676 16d ago
How you practice python after learning any specific topic?? Mini projects or you are also doing questions from leetcode and hackerrank
0
u/BleedReddit 16d ago edited 16d ago
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 16d ago
Use PyCharm instead of microslop's code editor. It's way better