You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Python_Programming_Quiz.md
+15Lines changed: 15 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,3 +102,18 @@ Methods | Description |
102
102
- Extensive Libraries
103
103
- Integration with other languages
104
104
- Databases Connectivity interfaces to all commercial databases
105
+
106
+
#### 6. How do you remove a duplicate from a Python list ? <br>
107
+
Convert the `list()` to `set()`
108
+
109
+
#### 7. What is the life cycle of a thread in Python ? <br>
110
+
A Thread is defined in computer science as the smallest unit that can be scheduled in an operating system
111
+
112
+
- To create a thread, we create a class that we make override the `run` method of the thread class. Then, we instantiate it.
113
+
- A thread that we just created is in the new state. When we make a call to `start()` on it, it forwards the threads for scheduling. These are in the ready state.
114
+
- When execution begins, the thread is in the running state.
115
+
- Calls to methods like `sleep()` and `wait()` make a thread wait. Such a thread is in the waiting/blocked state.
116
+
- When a thread is done waiting or executing, other waiting threads are sent for scheduling.
117
+
- A running thread that is done executing terminates and is in the dead state
118
+
119
+

0 commit comments