Python uses the threading library to support multithreading and some more functions. We can pass arguments while creating the thread which can then be used when the thread is running.
The passed parameters can be accessed using the array param[] that stores it.
Maruti Swift is Running 200
Hyundai I20 is Running 220
Maruti Swift is Running 200
Maruti Swift is Running 200
Maruti Swift is Running 200
Maruti Swift is Running 200
Hyundai I20 is Running 220
Maruti Swift is Running 200
Maruti Swift is Running 200
Maruti Swift is Running 200
Maruti Swift is Running 200
Maruti Swift is Running 200
Hyundai I20 is Running 220
...
...
Python program to illustrate parameterized threads
Output:
need an explanation for this answer? contact us directly to get an explanation for this answer