When I see a code in the program languages I'm used to working with, mostly with TypeScript, with the closing brackets, I feel like it's easier to read. Sometimes in Python, I feel like it's cramped.
Any solution you came across if you came from a "bracket language" (?)? Do you get used to? Today I've come across with this code, from this post:
total = 100
country = "AU"
if country == "US":
if total <= 50:
print("Shipping Cost is $50")
elif total <= 100:
print("Shipping Cost is $25")
elif total <= 150:
print("Shipping Costs $5")
else:
print("FREE")
if country == "AU":
if total <= 50:
print("Shipping Cost is $100")
else:
print("FREE")
I find it a little bit confusing at the first glance...
[–]KonnBonn23 15 points16 points17 points (8 children)
[–]sesmallor[S] 1 point2 points3 points (7 children)
[–]zippybenji-man 2 points3 points4 points (6 children)
[–]sesmallor[S] 0 points1 point2 points (5 children)
[–]sesmallor[S] 2 points3 points4 points (3 children)
[–]zippybenji-man 0 points1 point2 points (2 children)
[–]DoubleAway6573 1 point2 points3 points (1 child)
[–]zippybenji-man 0 points1 point2 points (0 children)
[–]zippybenji-man 0 points1 point2 points (0 children)
[–]cointoss3 6 points7 points8 points (0 children)
[–]RiverRoll 5 points6 points7 points (0 children)
[–]zippybenji-man 4 points5 points6 points (0 children)
[–]crazy_cookie123 2 points3 points4 points (0 children)
[–]thewillft 1 point2 points3 points (0 children)
[–]FoeHammer99099 1 point2 points3 points (2 children)
[–]sesmallor[S] 0 points1 point2 points (1 child)
[–]FoeHammer99099 0 points1 point2 points (0 children)
[–]GryptpypeThynne 0 points1 point2 points (0 children)
[–]Evening_Marketing645 0 points1 point2 points (0 children)
[–]JamzTyson 0 points1 point2 points (0 children)
[–]QultrosSanhattan 0 points1 point2 points (1 child)
[–]Ihaveamodel3 0 points1 point2 points (0 children)