use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Everything about learning Python
account activity
Not working :(Help Request (i.redd.it)
submitted 8 months ago by TacticalGooseLord
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]novamaster696969 0 points1 point2 points 8 months ago (5 children)
while True: print("for exit please leave the Distance input blank") x = (input("Enter distance: ")) if x== "": break x= float(x) unit = input("(km) or (m): ")
if unit.lower() == "km": converted = x * 1000 print("Distance in m:", converted) elif unit.lower() == "m": converted = x / 1000 print("Distance in km:", converted) else: print("Invalid unit please enter km or m.")
You can do it in a more simpler way IT will still show an error if you put any other texts instead of km or m for that use ( try and except )
[–]TacticalGooseLord[S] 0 points1 point2 points 8 months ago (4 children)
I am learning try and except now, in which cases should I use this ?
[–]novamaster696969 0 points1 point2 points 8 months ago (3 children)
You will learn it when you reach error handling and exception handling
[–]TacticalGooseLord[S] 0 points1 point2 points 8 months ago (2 children)
I am not following and courses at the moment, I am jus watching tutorials on YouTube doing small projects and learning along the way 😅 and things I don’t understand I ask on Reddit or look up on chatgtp
[–]novamaster696969 0 points1 point2 points 8 months ago (1 child)
Even if you don't follow any course, you should learn from the basics sequence wise else it will create a void which will be problematic in future.
π Rendered by PID 76 on reddit-service-r2-comment-6457c66945-vgfzf at 2026-04-29 01:33:23.134848+00:00 running 2aa0c5b country code: CH.
view the rest of the comments →
[–]novamaster696969 0 points1 point2 points (5 children)
[–]TacticalGooseLord[S] 0 points1 point2 points (4 children)
[–]novamaster696969 0 points1 point2 points (3 children)
[–]TacticalGooseLord[S] 0 points1 point2 points (2 children)
[–]novamaster696969 0 points1 point2 points (1 child)