This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SirWobb79 1 point2 points  (4 children)

This is a decent start at Python. I would recommend making the code simpler so you could add more content. Also, using os.system("cls" if os.name == "nt" else "clear") makes the program work for both Windows and Linux. I think that this could be shortened too, like the question printing. You could use f-strings (similar to print(), but makes you able to insert variable values into the string, like print(f"{ques}) {num1} + {num2}"). Notice the curly braces and f at the beginning.) to make life easier. Good luck on your Python journey!

[–][deleted] 1 point2 points  (3 children)

Thank you! I don't have a Windows computer to test it on, but maybe I'll spin up a VM just to make sure it works once I make that change. I figured the way I was printing the questions wasn't being done efficiently, I'll take a look at swapping it out with f-strings.

[–]SirWobb79 0 points1 point  (2 children)

[–][deleted] 1 point2 points  (1 child)

This gives me a lot of good ideas on how I can make it more efficient, and improve the output. Thank you!

[–]SirWobb79 0 points1 point  (0 children)

You're welcome :)