0

Timers and radication in Python

I basically want to make a better version of the basic calculator from the Python tutorial, but I have 2 problems First, I defined two functions: The first one ask the user if he want to exit or not the program before an operation. If they type "N", the program continue, and if they type "Y", the second function will be executed, that prints "Ending program..." and close the window. What I want to make is something like a timer, that each second prints a dot (".") and before 3 seconds it close the windows, instead of doing it automatically. How it's done? And the second question... I want to add potenciation a radication operations to this basic calculator... Potenciation is quite simple, but I don't know how to make radication. There is a library or something that allows me to do it? Any help is apreciated.

23rd Aug 2018, 3:18 PM
Mati Paredes
Mati Paredes - avatar
2 Answers
+ 1
import time time.sleep(t) #t is a number/the programm waits t sec.
27th Aug 2018, 3:41 PM
Anton Böhler
Anton Böhler - avatar
0
I already figured out how to make radication (forgot that it was like calculating x^(1/y))
27th Aug 2018, 10:02 PM
Mati Paredes
Mati Paredes - avatar