FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-practice/chapter02/practice02.py at master · linuxwd/python-practice · GitHub
linuxwd
python-practice
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-practice
/
chapter02
/
practice02.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
28 lines (21 loc) · 838 Bytes
Breadcrumbs
python-practice
/
chapter02
/
practice02.py
Copy path
File metadata and controls
28 lines (21 loc) · 838 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#-------------------------------------------------------------------------------
# Name: 模块1
# Purpose:
#
# Author: Administrator
#
# Created: 06-01-2013
# Copyright: (c) Administrator 2013
# Licence: <your licence>
#-------------------------------------------------------------------------------
movies
=
[
"The Holy Grail"
,
1975
,
"Terry Jones & Terry Gilliam"
,
91
,[
"Graham Chapman"
,[
"Michael Plain"
,
"John Cleese"
,
"Terry Gilliam"
,
"Eric Idle"
,
"Terry Jones"
]]]
def
print_lol
(
the_list
,
indent
=
False
,
level
=
0
):
for
each_item
in
the_list
:
if
isinstance
(
each_item
,
list
):
print_lol
(
each_item
,
indent
,
level
+
1
)
else
:
if
indent
:
for
tab_stop
in
range
(
level
):
print
(
"
\t
"
,
end
=
""
)
print
(
each_item
)
print_lol
(
movies
,
indent
=
True
,
level
=
0
)
Back
|
FazBrowse Home
|
New Git URL