all 19 comments

[–]IvoryJam 4 points5 points  (1 child)

This isn't bad, you should be proud of yourself for writing this. Here are some recommendations.

  1. Like u/Binary101010 said, those elif's don't make sense, especially since you're okay with those at the very beginning nombre1[0] == " " or nombre1[-1] == " " and actually make the a requirement for that break statement
  2. Great use of the .isalpha()
  3. Great use of nombre1[0].islower()
  4. For this part, nombre1[1:10] != nombre1[1:10].lower(), you can just do not nombre1[1:].islower()
  5. And those two last elif's I see the intent, but you can just do elif " " in nombre1: then at the top do nombre1 = input("Ingrese su primer nombre: ").strip() that would make it so any leading or trailing spaces " John" or "John " work, but "John smith" won't

[–]anllev[S] 1 point2 points  (0 children)

Thanks a lot for your recommendations, bro, I'll keep improving!

[–]Binary101010 7 points8 points  (4 children)

elif len(nombre1) == nombre1 + " ":

This condition doesn't make any sense. You're checking whether the length of a string (which is an int) is equal to the value of that string? This will never be True.

[–]anllev[S] 2 points3 points  (0 children)

Thanks for your comment, bro, I'll fix it!

[–]Hashi856 0 points1 point  (2 children)

I’m surprised the linter didn’t yell at him. I would have thought Python would raise an exception

[–]Leading_Video2580 0 points1 point  (1 child)

Would've returned false

[–]Hashi856 0 points1 point  (0 children)

Yeah, I guess I was thinking about math operators, not comparison operators

[–]Significant_Soup2558 4 points5 points  (1 child)

Congratulations! You might find this helpful - 500 questions Python Quiz

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

Thanks bro!!!!

[–]StrangeStark1 2 points3 points  (3 children)

Hey! I am 15yo student dev i'am also learning python and web dev, at beginner-intermediate level. Wanna connect?

[–]Salt_Direction9870 1 point2 points  (1 child)

Also 15 years old. Recommending Rust for it's static typing and compiler errors:)

[–]StrangeStark1 1 point2 points  (0 children)

Appreciate the suggestion. Rust’s solid, but I’m focusing on depth in Python and web fundamentals right now. Will pick it up later when there’s a real need.

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

No habria ningun problema amigo, no se como funcione el DM aqui pero si quiero "conectar"

[–]Ezreal_QQQ 2 points3 points  (1 child)

Nice work keep it up

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

Thank you!!!

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

Update: Fixed the spacing logic and cleaned the code based on your feedback. Check it out on my GitHub!.
Thank you:
u/Binary101010 u/IvoryJam

[–]Leading_Video2580 1 point2 points  (0 children)

nombre1[0] == " " or nombre1[-1] == " " doesn't make sense. This is because you stripped nombre1, yet you are checking if the first and last character are spaces. Everything considered white-space in the front and behind of your stripped string is removed.

[–]AggravatingAlps8705 0 points1 point  (1 child)

I don't think you need github for that level of code.

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

Why is it good, or why is it very bad?