Multithreading in python | Sololearn: Learn to code for FREE!


Multithreading in python

Please check the code and help to remove bug and run this. from threading import * class hello(): def run(self): for i in range(200): print("Hello") class hii(): def run(self): for i in range(200): print("Hii") h1=hello() h2=hii() h1.start() h2.start()

4/30/2020 6:13:23 PM

Hasnain Jeelani

4 Answers

New Answer


a=Thread( b=Thread( a.start() b.start()


You need to make your custom classes inherit from the Thread class like this : class hello(Thread): Then the code will run.


you are not using threading, you just imported it. and your classes have run() methods not start()


I have tried that too putting thread in class but the error is “”not able to call list like this