exam questions

Exam 350-901 All Questions

View all questions & answers for the 350-901 exam

Exam 350-901 topic 1 question 93 discussion

Actual exam question from Cisco's 350-901
Question #: 93
Topic #: 1
[All 350-901 Questions]

DRAG DROP -

Refer to the exhibit. Python threading allows a developer to have different parts of a program run concurrently and simplify a design. Drag and drop the code snippets from the left onto the item numbers on the right that match the missing sections in the exhibit to create a thread instance.
Select and Place:

Show Suggested Answer Hide Answer
Suggested Answer:

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
blezzzo
Highly Voted 2 years, 9 months ago
I concur with FR99. 1. threading.Thread 2. target 3. args 4. start() 5. join() Explanation: Threading in python is used to run multiple threads (tasks, function calls) at the same time. Note that this does not mean that they are executed on different CPUs. Python threads are used in cases where the execution of a task involves some waiting. One example would be interaction with a service hosted on another computer, such as a webserver. Threading allows python to execute other code while waiting; this is easily simulated with the sleep function. import time import threading def myfunc(name): print(f'myfunc started with {name}') time.sleep(10) print('myfunc ended') if __name__ == '__main__': print('main started') thread = threading.Thread(target=myfunc,args=['realpython']) thread.start() print('main ended') https://realpython.com/lessons/two-threads/
upvoted 14 times
...
FR99
Highly Voted 2 years, 9 months ago
Agree with answer being: 1. threading.Thread 2. target 3. args 4. start() 5. join()
upvoted 7 times
...
Ietsmeteennaam
Most Recent 2 days, 6 hours ago
Just for ones wondering what join() does(as i did): https://stackoverflow.com/questions/15085348/what-is-the-use-of-join-in-threading This also explains where join() needs to be placed (after the start()).
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago