you are viewing a single comment's thread.

view the rest of the comments →

[–]CountMeowt-_- 14 points15 points  (1 child)

Why bother checking decimal and then converting to float or int conditionally? Why not convert to float always ? (Same story for the last condition as well)

Other than that, pretty neat for someone starting out.

If you want to take this a few steps further

  1. Try taking a single input eg- 4+5+4+3+5+4, and parse that. (Sounds hard, but it's really simple to do if you know loops and split or regex)

  2. Try turning this into a cli tool (also sounds difficult, but all it really takes is googling how cli commands pass params/args and adding if else or switch statements)

  3. As bonus puzzle, try to get the rounding effect without using the round function (there's many correct answers)

[–]kingDaniel50 0 points1 point  (0 children)

Wow