Python Exercise Example 9
**Problem:** Pause for one second before outputting.
**Program Analysis:** Use the sleep() function of the time module.
Program source code:
Example
#!/usr/bin/python
-- coding: UTF-8 --
import
time
myD
= {
1
:
'
a
'
,
2
:
'
b
'
}
for
key
,
value
in
dict
.
items
(
myD
)
:
(
key
,
value
)
time
.
sleep
(
1
)
Pause for 1 second
The output of the above example is (there will be a pause effect):
1 a
2 b
Python 100 Examples