资源简介

python基础教程第三版源代码 python基础教程第三版源代码

资源截图

代码片段和文件信息

# Print out a date given year month and day as numbers

months = [
    ‘January‘
    ‘February‘
    ‘March‘
    ‘April‘
    ‘May‘
    ‘June‘
    ‘July‘
    ‘August‘
    ‘September‘
    ‘October‘
    ‘November‘
    ‘December‘
]

# A list with one ending for each number from 1 to 31
endings = [‘st‘ ‘nd‘ ‘rd‘] + 17 * [‘th‘] \
        + [‘st‘ ‘nd‘ ‘rd‘] +  7 * [‘th‘] \
        + [‘st‘]

year    = input(‘Year: ‘)
month   = input(‘Month  (1-12): ‘)
day     = input(‘Day (1-31): ‘)

month_number = int(month)
day_number = int(day)

# Remember to subtract 1 from month and day to get a correct index
month_name = months[month_number-1]
ordinal = day + endings[day_number-1]

print(month_name + ‘ ‘ + ordinal + ‘ ‘ + year)

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      25963  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\9781484200292.jpg

     文件        736  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter02\listing2-1.py

     文件        144  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter02\listing2-2.py

     文件        550  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter02\listing2-3.py

     文件        263  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter02\listing2-4.py

     文件        572  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter03\listing3-1.py

     文件       1012  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter04\listing4-1.py

     文件        616  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter04\listing4-2.py

     文件         33  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-1.py

     文件        158  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-10.py

     文件        799  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-11.py

     文件         50  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-12.txt

     文件        104  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-13.txt

     文件        251  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-14.txt

     文件         51  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-2.py

     文件         71  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-3.py

     文件        111  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-4.py

     文件         84  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-5.py

     文件        179  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-6.py

     文件       1536  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter10\listing10-8.py

     文件        125  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-1.py

     文件         78  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-10.py

     文件         73  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-11.py

     文件         66  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-12.py

     文件         45  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-13.py

     文件         66  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-2.txt

     文件         67  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-3.txt

     文件         16  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-4.txt

     文件         18  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-5.txt

     文件        109  2017-03-09 22:57  Beginning Python_version3_SourceCode\beginning-python-3ed-master\Chapter11\listing11-6.py

............此处省略107个文件信息

评论

共有 条评论