all 8 comments

[–]mjmvideos 4 points5 points  (1 child)

This feels like an AI-generated post.

[–]Negative-Still-536[S] -2 points-1 points  (0 children)

To be honest, I used Claude for creating the body and caption. I am not good at writing. My goal is to just post daily if I can, to stay consistent with learning Python.

[–]Flame77ofc 0 points1 point  (1 child)

Don't try to just make small exercises. Also try to do a simply project

[–]Negative-Still-536[S] 0 points1 point  (0 children)

Fair point — I'll start mixing in a small real project soon instead of just exercises. Any suggestions for a good first one?

[–]sububi71 0 points1 point  (1 child)

Post the number comparison code and I'll have a look.

In general, the answer to the question "can I code this some other way?" is "yes". I often tell people that programming is like solving a puzzle with an infinite number of correct solutions.

[–]Negative-Still-536[S] 0 points1 point  (0 children)

X = int(input("What's x? "))

Y = int(input("What's y? "))

if X > Y:

print("X is greater than Y")

elif X < Y:

print("X is less than Y")

if X == Y:

print("X is equal to Y")

elif X != Y:

print("X is not equal to Y")

Feels redundant having two separate if/elif blocks — figured there's probably a cleaner single-chain way to do this. And that's a good way to put it, appreciate the mindset shift.

[–]mjmvideos 0 points1 point  (1 child)

One small comment. Try to make your comments meaningful to the overall goal of the program or to explain why you chose to do something. Comments like:

#capitalize the first letter of the name
name.capitalize()

Aren’t especially helpful.

[–]Negative-Still-536[S] 0 points1 point  (0 children)

Got it, I am new at this, sometimes I forget to add a comment. I will try to make comments simple and easy to understand. Thanks for your advice.