Untitled
import threading class f(threading.Thread): def __init__(self,n): super().__init__() self.__n=n def run(self): if self.__n%2==0: print(self.__n," is even") else: print(self.__n," is odd") def main(): x=int(input("Enter the num1:")) y=int(input("Enter the num2:")) for i in range(x,y+1): x=f(i) x.start() main()
Leave a Comment