├── com
├── __init__.py
├── python100
│ ├── __init__.py
│ ├── example
│ │ ├── __init__.py
│ │ ├── main
│ │ │ ├── __init__.py
│ │ │ ├── testfile
│ │ │ │ ├── A
│ │ │ │ ├── B
│ │ │ │ └── C
│ │ │ └── Main.py
│ │ ├── files
│ │ │ ├── __init__.py
│ │ │ ├── __pycache__
│ │ │ │ ├── Example1.cpython-35.pyc
│ │ │ │ ├── Example10.cpython-35.pyc
│ │ │ │ ├── Example100.cpython-35.pyc
│ │ │ │ ├── Example11.cpython-35.pyc
│ │ │ │ ├── Example12.cpython-35.pyc
│ │ │ │ ├── Example13.cpython-35.pyc
│ │ │ │ ├── Example14.cpython-35.pyc
│ │ │ │ ├── Example15.cpython-35.pyc
│ │ │ │ ├── Example16.cpython-35.pyc
│ │ │ │ ├── Example17.cpython-35.pyc
│ │ │ │ ├── Example18.cpython-35.pyc
│ │ │ │ ├── Example19.cpython-35.pyc
│ │ │ │ ├── Example2.cpython-35.pyc
│ │ │ │ ├── Example20.cpython-35.pyc
│ │ │ │ ├── Example21.cpython-35.pyc
│ │ │ │ ├── Example22.cpython-35.pyc
│ │ │ │ ├── Example23.cpython-35.pyc
│ │ │ │ ├── Example24.cpython-35.pyc
│ │ │ │ ├── Example25.cpython-35.pyc
│ │ │ │ ├── Example26.cpython-35.pyc
│ │ │ │ ├── Example27.cpython-35.pyc
│ │ │ │ ├── Example28.cpython-35.pyc
│ │ │ │ ├── Example29.cpython-35.pyc
│ │ │ │ ├── Example3.cpython-35.pyc
│ │ │ │ ├── Example30.cpython-35.pyc
│ │ │ │ ├── Example31.cpython-35.pyc
│ │ │ │ ├── Example32.cpython-35.pyc
│ │ │ │ ├── Example33.cpython-35.pyc
│ │ │ │ ├── Example34.cpython-35.pyc
│ │ │ │ ├── Example35.cpython-35.pyc
│ │ │ │ ├── Example36.cpython-35.pyc
│ │ │ │ ├── Example37.cpython-35.pyc
│ │ │ │ ├── Example38.cpython-35.pyc
│ │ │ │ ├── Example39.cpython-35.pyc
│ │ │ │ ├── Example4.cpython-35.pyc
│ │ │ │ ├── Example40.cpython-35.pyc
│ │ │ │ ├── Example41.cpython-35.pyc
│ │ │ │ ├── Example44.cpython-35.pyc
│ │ │ │ ├── Example45.cpython-35.pyc
│ │ │ │ ├── Example46.cpython-35.pyc
│ │ │ │ ├── Example47.cpython-35.pyc
│ │ │ │ ├── Example48.cpython-35.pyc
│ │ │ │ ├── Example49.cpython-35.pyc
│ │ │ │ ├── Example5.cpython-35.pyc
│ │ │ │ ├── Example50.cpython-35.pyc
│ │ │ │ ├── Example51.cpython-35.pyc
│ │ │ │ ├── Example52.cpython-35.pyc
│ │ │ │ ├── Example53.cpython-35.pyc
│ │ │ │ ├── Example54.cpython-35.pyc
│ │ │ │ ├── Example55.cpython-35.pyc
│ │ │ │ ├── Example56.cpython-35.pyc
│ │ │ │ ├── Example57.cpython-35.pyc
│ │ │ │ ├── Example58.cpython-35.pyc
│ │ │ │ ├── Example59.cpython-35.pyc
│ │ │ │ ├── Example6.cpython-35.pyc
│ │ │ │ ├── Example60.cpython-35.pyc
│ │ │ │ ├── Example61.cpython-35.pyc
│ │ │ │ ├── Example62.cpython-35.pyc
│ │ │ │ ├── Example66.cpython-35.pyc
│ │ │ │ ├── Example67.cpython-35.pyc
│ │ │ │ ├── Example68.cpython-35.pyc
│ │ │ │ ├── Example69.cpython-35.pyc
│ │ │ │ ├── Example7.cpython-35.pyc
│ │ │ │ ├── Example70.cpython-35.pyc
│ │ │ │ ├── Example71.cpython-35.pyc
│ │ │ │ ├── Example72.cpython-35.pyc
│ │ │ │ ├── Example73.cpython-35.pyc
│ │ │ │ ├── Example74.cpython-35.pyc
│ │ │ │ ├── Example75.cpython-35.pyc
│ │ │ │ ├── Example76.cpython-35.pyc
│ │ │ │ ├── Example77.cpython-35.pyc
│ │ │ │ ├── Example78.cpython-35.pyc
│ │ │ │ ├── Example79.cpython-35.pyc
│ │ │ │ ├── Example8.cpython-35.pyc
│ │ │ │ ├── Example80.cpython-35.pyc
│ │ │ │ ├── Example81.cpython-35.pyc
│ │ │ │ ├── Example82.cpython-35.pyc
│ │ │ │ ├── Example83.cpython-35.pyc
│ │ │ │ ├── Example84.cpython-35.pyc
│ │ │ │ ├── Example85.cpython-35.pyc
│ │ │ │ ├── Example86.cpython-35.pyc
│ │ │ │ ├── Example87.cpython-35.pyc
│ │ │ │ ├── Example88.cpython-35.pyc
│ │ │ │ ├── Example89.cpython-35.pyc
│ │ │ │ ├── Example9.cpython-35.pyc
│ │ │ │ ├── Example90.cpython-35.pyc
│ │ │ │ ├── Example91.cpython-35.pyc
│ │ │ │ ├── Example92.cpython-35.pyc
│ │ │ │ ├── Example93.cpython-35.pyc
│ │ │ │ ├── Example94.cpython-35.pyc
│ │ │ │ ├── Example95.cpython-35.pyc
│ │ │ │ ├── Example96.cpython-35.pyc
│ │ │ │ ├── Example97.cpython-35.pyc
│ │ │ │ ├── Example98.cpython-35.pyc
│ │ │ │ ├── Example99.cpython-35.pyc
│ │ │ │ ├── TestUtils.cpython-35.pyc
│ │ │ │ ├── __init__.cpython-35.pyc
│ │ │ │ └── ExampleBase.cpython-35.pyc
│ │ │ ├── Example41.py
│ │ │ ├── Example59.py
│ │ │ ├── Example34.py
│ │ │ ├── Example42.py
│ │ │ ├── ExampleBase.py
│ │ │ ├── Example43.py
│ │ │ ├── Example60.py
│ │ │ ├── Example50.py
│ │ │ ├── Example55.py
│ │ │ ├── Example51.py
│ │ │ ├── Example19.py
│ │ │ ├── TestUtils.py
│ │ │ ├── Example32.py
│ │ │ ├── Example52.py
│ │ │ ├── Example84.py
│ │ │ ├── Example49.py
│ │ │ ├── Example86.py
│ │ │ ├── Example53.py
│ │ │ ├── Example62.py
│ │ │ ├── Example70.py
│ │ │ ├── Example9.py
│ │ │ ├── Example95.py
│ │ │ ├── Example40.py
│ │ │ ├── Example77.py
│ │ │ ├── Example96.py
│ │ │ ├── Example33.py
│ │ │ ├── Example72.py
│ │ │ ├── Example47.py
│ │ │ ├── Example75.py
│ │ │ ├── Example98.py
│ │ │ ├── Example8.py
│ │ │ ├── Example91.py
│ │ │ ├── Example66.py
│ │ │ ├── Example26.py
│ │ │ ├── Example45.py
│ │ │ ├── Example10.py
│ │ │ ├── Example73.py
│ │ │ ├── Example74.py
│ │ │ ├── Example58.py
│ │ │ ├── Example57.py
│ │ │ ├── Example92.py
│ │ │ ├── Example79.py
│ │ │ ├── Example24.py
│ │ │ ├── Example7.py
│ │ │ ├── Example87.py
│ │ │ ├── Example68.py
│ │ │ ├── Example88.py
│ │ │ ├── Example3.py
│ │ │ ├── Example54.py
│ │ │ ├── Example93.py
│ │ │ ├── Example11.py
│ │ │ ├── Example82.py
│ │ │ ├── Example27.py
│ │ │ ├── Example35.py
│ │ │ ├── Example36.py
│ │ │ ├── Example25.py
│ │ │ ├── Example78.py
│ │ │ ├── Example5.py
│ │ │ ├── Example97.py
│ │ │ ├── Example28.py
│ │ │ ├── Example29.py
│ │ │ ├── Example100.py
│ │ │ ├── Example56.py
│ │ │ ├── Example21.py
│ │ │ ├── Example13.py
│ │ │ ├── Example37.py
│ │ │ ├── Example20.py
│ │ │ ├── Example83.py
│ │ │ ├── Example12.py
│ │ │ ├── Example90.py
│ │ │ ├── Example85.py
│ │ │ ├── Example44.py
│ │ │ ├── Example99.py
│ │ │ ├── Example69.py
│ │ │ ├── Example46.py
│ │ │ ├── Example15.py
│ │ │ ├── Example76.py
│ │ │ ├── Example89.py
│ │ │ ├── Example30.py
│ │ │ ├── Example81.py
│ │ │ ├── Example38.py
│ │ │ ├── Example17.py
│ │ │ ├── Example48.py
│ │ │ ├── Example23.py
│ │ │ ├── Example6.py
│ │ │ ├── Example16.py
│ │ │ ├── Example67.py
│ │ │ ├── Example1.py
│ │ │ ├── Example80.py
│ │ │ ├── Example71.py
│ │ │ ├── Example61.py
│ │ │ ├── Example39.py
│ │ │ ├── Example22.py
│ │ │ ├── Example31.py
│ │ │ ├── Example14.py
│ │ │ ├── Example18.py
│ │ │ ├── Example94.py
│ │ │ ├── Example2.py
│ │ │ └── Example4.py
│ │ └── __pycache__
│ │ │ └── __init__.cpython-35.pyc
│ └── __pycache__
│ │ └── __init__.cpython-35.pyc
└── __pycache__
│ └── __init__.cpython-35.pyc
├── .gitignore
├── .idea
├── modules.xml
└── Python100example.iml
├── read.txt
└── README.md
/com/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com/python100/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com/python100/example/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | /.idea/workspace.xml
2 |
--------------------------------------------------------------------------------
/com/python100/example/main/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com/python100/example/files/__init__.py:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/com/python100/example/main/testfile/A:
--------------------------------------------------------------------------------
1 | hklasdga
--------------------------------------------------------------------------------
/com/python100/example/main/testfile/B:
--------------------------------------------------------------------------------
1 | aqwenzxvczmnm
--------------------------------------------------------------------------------
/com/python100/example/main/testfile/C:
--------------------------------------------------------------------------------
1 | aaacdeghklmmnnqsvwxzz
--------------------------------------------------------------------------------
/com/__pycache__/__init__.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/__pycache__/__init__.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/__pycache__/__init__.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/__pycache__/__init__.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/__pycache__/__init__.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/__pycache__/__init__.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example1.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example1.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example10.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example10.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example100.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example100.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example11.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example11.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example12.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example12.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example13.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example13.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example14.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example14.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example15.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example15.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example16.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example16.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example17.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example17.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example18.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example18.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example19.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example19.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example2.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example2.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example20.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example20.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example21.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example21.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example22.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example22.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example23.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example23.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example24.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example24.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example25.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example25.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example26.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example26.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example27.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example27.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example28.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example28.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example29.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example29.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example3.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example3.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example30.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example30.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example31.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example31.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example32.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example32.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example33.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example33.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example34.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example34.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example35.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example35.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example36.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example36.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example37.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example37.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example38.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example38.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example39.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example39.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example4.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example4.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example40.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example40.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example41.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example41.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example44.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example44.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example45.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example45.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example46.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example46.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example47.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example47.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example48.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example48.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example49.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example49.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example5.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example5.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example50.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example50.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example51.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example51.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example52.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example52.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example53.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example53.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example54.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example54.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example55.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example55.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example56.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example56.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example57.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example57.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example58.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example58.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example59.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example59.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example6.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example6.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example60.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example60.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example61.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example61.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example62.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example62.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example66.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example66.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example67.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example67.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example68.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example68.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example69.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example69.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example7.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example7.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example70.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example70.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example71.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example71.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example72.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example72.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example73.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example73.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example74.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example74.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example75.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example75.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example76.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example76.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example77.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example77.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example78.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example78.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example79.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example79.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example8.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example8.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example80.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example80.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example81.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example81.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example82.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example82.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example83.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example83.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example84.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example84.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example85.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example85.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example86.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example86.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example87.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example87.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example88.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example88.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example89.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example89.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example9.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example9.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example90.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example90.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example91.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example91.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example92.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example92.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example93.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example93.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example94.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example94.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example95.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example95.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example96.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example96.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example97.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example97.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example98.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example98.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/Example99.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/Example99.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/TestUtils.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/TestUtils.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/__init__.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/__init__.cpython-35.pyc
--------------------------------------------------------------------------------
/com/python100/example/files/__pycache__/ExampleBase.cpython-35.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/helloalvin/Python100example/HEAD/com/python100/example/files/__pycache__/ExampleBase.cpython-35.pyc
--------------------------------------------------------------------------------
/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example41.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example41
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午6:43
8 |
9 | """模仿静态变量的用法"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 | class Example41(ExampleBase):
13 | def execute(self):
14 | pass
15 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example59.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example59
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午9:31
8 |
9 | """画图,综合例子"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example59(ExampleBase):
14 | def execute(self):
15 | pass
16 |
17 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example34.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example34
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午4:12
8 |
9 | """练习函数调用。"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example34(ExampleBase):
15 | def execute(self):
16 | pass
17 |
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example42.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example42
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午6:59
8 |
9 | """学习使用auto定义变量的用法"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 | class Example42(ExampleBase):
13 | def execute(self):
14 | pass
15 |
16 |
--------------------------------------------------------------------------------
/com/python100/example/files/ExampleBase.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: ExampleBase
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/14 下午3:54
8 |
9 | """基类"""
10 | import abc
11 | from abc import *
12 |
13 |
14 | class ExampleBase(metaclass=abc.ABCMeta):
15 | @abstractclassmethod
16 | def execute(self):
17 | pass
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example43.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example43
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午7:15
8 |
9 | """模仿静态变量(static)另一案例。"""
10 |
11 |
12 | from com.python100.example.files.ExampleBase import *
13 |
14 | class Example43(ExampleBase):
15 | def execute(self):
16 | pass
17 |
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example60.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example60
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午9:32
8 |
9 | """计算字符串长度。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example60(ExampleBase):
14 | def execute(self):
15 | print(str(len('as;jkj;asdf')))
16 |
17 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example50.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example50
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午11:14
8 |
9 | """输出一个随机数。"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 | import random
13 |
14 | class Example50(ExampleBase):
15 | def execute(self):
16 | print(random.random())
17 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example55.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example55
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午8:56
8 |
9 | """学习使用按位取反~"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example55(ExampleBase):
14 | def execute(self):
15 | a = 3
16 | print(str(bin(~a)))
17 |
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example51.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example51
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午8:30
8 |
9 | """学习使用按位与 & """
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example51(ExampleBase):
14 | def execute(self):
15 | a = 7
16 | b = 1
17 | print(str(a&b))
--------------------------------------------------------------------------------
/.idea/Python100example.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example19.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example19
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/17 下午11:12
8 |
9 | """ 一个数如果恰好等于它的因子之和,这个数就称为"完数"。例如6=1+2+3.编程找出1000以内的所有完数。"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example19(ExampleBase):
15 | def execute(self):
16 | pass
17 |
--------------------------------------------------------------------------------
/com/python100/example/files/TestUtils.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: TestUtils
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/16 下午11:22
8 |
9 | """"""
10 | from com.python100.example.files.ExampleBase import *
11 | from keyword import kwlist
12 | from builtins import *
13 |
14 | class TestUtils(ExampleBase):
15 | def execute(self):
16 | print(kwlist)
17 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example32.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example32
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午3:46
8 |
9 | """按相反的顺序输出列表的值"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example32(ExampleBase):
14 | def execute(self):
15 | result = [1,2,3,4,5,6,7,8,9]
16 | print(result[::-1])
17 |
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example52.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example52
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午8:33
8 |
9 | """学习使用按位或 | 。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example52(ExampleBase):
14 | def execute(self):
15 | a = 3
16 | b = 0o77
17 | print(str(a|b))
18 |
19 |
20 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example84.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example84
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午10:11
8 |
9 | """连接字符串。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example84(ExampleBase):
14 | def execute(self):
15 | data = ['a', 'b', 'c', 'd', 'e', 'f']
16 | print(' '.join(data))
17 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example49.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example49
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午11:14
8 |
9 | """使用lambda来创建匿名函数"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example49(ExampleBase):
15 | def execute(self):
16 | fun = lambda x, y, z: x * y * z
17 | print(fun(2, 3, 4))
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example86.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example86
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午10:27
8 |
9 | """两个字符串连接程序"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example86(ExampleBase):
14 | def execute(self):
15 | a = 'asdfasdf'
16 | b = 'bnbnlb2464356435'
17 | print(a+b)
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example53.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example53
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午8:42
8 |
9 | """学习使用按位异或 ^ """
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example53(ExampleBase):
14 | def execute(self):
15 | a = 0b00101100
16 | b = 0b10000111
17 | print(str(bin(a^b)))
18 |
19 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example62.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example62
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 下午10:10
8 |
9 | """查找字符串"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example62(ExampleBase):
14 | def execute(self):
15 | datas = 'askjdasjga;sd'
16 | key = 'jd'
17 | print(str(datas.find(key)))
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example70.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example70
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 下午10:50
8 |
9 | """写一个函数,求一个字符串的长度,在main函数中输入字符串,并输出其长度。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example70(ExampleBase):
14 | def execute(self):
15 | s = input('请输入字符串:')
16 | print(str(len(s)))
17 |
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example9.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example9
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午5:51
8 |
9 | """暂停一秒输出。"""
10 | from com.python100.example.files.ExampleBase import *
11 | import time
12 |
13 | class Example9(ExampleBase):
14 | def execute(self):
15 | for i in range(1,4):
16 | time.sleep(1)
17 | print(str(i)+' ',)
18 |
19 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example95.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example95
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 下午5:37
8 |
9 | """字符串日期转换为易读的日期格式"""
10 | from com.python100.example.files.ExampleBase import *
11 | from dateutil import parser
12 |
13 | class Example95(ExampleBase):
14 | def execute(self):
15 | dt = parser.parse("Oct 24 2018 11:00AM")
16 | print(dt)
17 |
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example40.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example40
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午6:39
8 |
9 | """将一个数组逆序输出"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example40(ExampleBase):
15 | datas = ['a','b','c','d','e','f','g']
16 |
17 | def execute(self):
18 | self.datas.reverse()
19 | print(self.datas)
20 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example77.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example77
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午5:04
8 |
9 | """循环输出列表"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example77(ExampleBase):
14 | def execute(self):
15 | datas = ['1','2','3','4','5','6']
16 | for i in range(0,len(datas)):
17 | print(datas[i],end=',')
18 |
19 |
20 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example96.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example96
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 下午5:37
8 |
9 | """计算字符串中子串出现的次数。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example96(ExampleBase):
14 | def execute(self):
15 | str1 = input('请输入一段内容:')
16 | str2 = input('请输入关键内容:')
17 | print('总共包含关键内容'+str(str1.count(str2))+'次')
18 |
19 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example33.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example33
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午4:03
8 |
9 | """按逗号分隔列表"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example33(ExampleBase):
14 | def execute(self):
15 | result = [1,2,3,4,5,6,7,8,9]
16 | print(','.join(str(L) for L in result))
17 | for L in result:
18 | print(str(L),end=',')
19 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example72.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example72
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午12:34
8 |
9 | """创建一个链表"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example72(ExampleBase):
14 | result = []
15 | def execute(self):
16 | for i in range(0,6):
17 | s = input('请输入:')
18 | self.result.append(s)
19 | print(self.result)
20 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example47.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example47
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午11:09
8 |
9 | """两个变量值互换。"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example47(ExampleBase):
15 | def execute(self):
16 | a = 1
17 | b = 2
18 | print('交换前a='+str(a)+',b='+str(b))
19 | a,b=b,a
20 | print('交换后a=' + str(a) + ',b=' + str(b))
21 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example75.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example75
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午12:48
8 |
9 | """放松一下,算一道简单的题目"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example75(ExampleBase):
14 | def execute(self):
15 | sum = 0
16 | for i in range(1,37):
17 | sum+=i
18 | if i == 24:
19 | print(sum)
20 | print(sum)
21 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example98.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example98
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 下午5:38
8 |
9 | """从键盘输入一个字符串,将小写字母全部转换成大写字母,然后输出到一个磁盘文件"test"中保存。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example98(ExampleBase):
14 | def execute(self):
15 | strs = input('请输入字符串:')
16 | fp = open('test', "w")
17 | fp.write(strs.upper())
18 | fp.close()
19 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example8.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example8
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午5:18
8 |
9 | """输出 9*9 乘法口诀表"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example8(ExampleBase):
14 | def execute(self):
15 | for i in range(1, 10):
16 | for j in range(1, i + 1):
17 | print(str(j) + '*' + str(i) + '=' + str(i * j) + ' ',end='' if i!=j else '\n')
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example91.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example91
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 上午9:06
8 |
9 | """时间函数举例1"""
10 | from com.python100.example.files.ExampleBase import *
11 | import time
12 |
13 | class Example91(ExampleBase):
14 | def execute(self):
15 | print(time.ctime(time.time()))
16 | print(time.asctime(time.localtime(time.time())))
17 | print(time.asctime(time.gmtime(time.time())))
18 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example66.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example66
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 下午10:15
8 |
9 | """输入3个数a,b,c,按大小顺序输出。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example66(ExampleBase):
14 | def execute(self):
15 | data = []
16 | for i in range(0,3):
17 | k = input('输入一个数字:')
18 | data.append(int(k))
19 | print(sorted(data))
20 |
21 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example26.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example26
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午1:04
8 |
9 | """利用递归方法求5!。"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example26(ExampleBase):
15 | def execute(self):
16 | print(self.fac(5))
17 |
18 | def fac(self, n):
19 | if n > 1:
20 | return n * self.fac(n - 1)
21 | else:
22 | return 1
23 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example45.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example45
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午10:35
8 |
9 | """统计 1 到 100 之和"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 | from functools import reduce
14 | class Example45(ExampleBase):
15 | def execute(self):
16 | d = []
17 | for i in range(1, 101):
18 | d.append(i)
19 | sum = reduce(lambda x, y: x + y, d)
20 | print(sum)
21 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example10.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example10
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午5:59
8 |
9 | """暂停一秒输出,并格式化当前时间"""
10 | from com.python100.example.files.ExampleBase import *
11 | import time
12 |
13 |
14 | class Example10(ExampleBase):
15 | def execute(self):
16 | print('wait for 1 second to output current time:')
17 | time.sleep(1)
18 | print(time.strftime("%Y-%m-%d %H-%M-%S",time.localtime(time.time())))
19 |
20 |
21 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example73.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example73
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午12:41
8 |
9 | """反向输出一个链表"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example73(ExampleBase):
14 | result = []
15 |
16 | def execute(self):
17 | for i in range(0, 6):
18 | s = input('请输入:')
19 | self.result.append(s)
20 | self.result.reverse()
21 | print(self.result)
22 |
23 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example74.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example74
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午12:43
8 |
9 | """列表排序及连接"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example74(ExampleBase):
14 | def execute(self):
15 | a = [3,5,1,2]
16 | b = ['a','b','c','d','e']
17 | print(a)
18 | a.sort()
19 | print('sorted:'+str(a))
20 | a.extend(b)
21 | print('a+b:'+str(a))
22 |
23 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example58.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example58
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午9:17
8 |
9 | """画图,学用rectangle画方形。"""
10 | from com.python100.example.files.ExampleBase import *
11 | from tkinter import *
12 |
13 | class Example58(ExampleBase):
14 | def execute(self):
15 | canvas = Canvas(width=600, height=400, bg='yellow')
16 | canvas.create_rectangle(100,100,300,300,fill='RED')
17 | canvas.pack()
18 | mainloop()
19 |
20 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example57.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example57
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午9:12
8 |
9 | """画图,学用line画直线"""
10 | from com.python100.example.files.ExampleBase import *
11 | from tkinter import *
12 |
13 | class Example57(ExampleBase):
14 | def execute(self):
15 | canvas = Canvas(width=600, height=400, bg='yellow')
16 | canvas.pack(expand=YES, fill=BOTH)
17 | canvas.create_line(0, 0, 300, 200, fill='red')
18 | mainloop()
19 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example92.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example92
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 上午9:20
8 |
9 | """时间函数举例2。"""
10 | from com.python100.example.files.ExampleBase import *
11 | import time
12 |
13 |
14 | class Example92(ExampleBase):
15 | def execute(self):
16 | start = time.time()
17 | print('begin time:' + str(start))
18 | for i in range(0, 3000):
19 | print(i, end='')
20 | print('end time:' + str(time.time() - start))
21 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example79.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example79
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午5:15
8 |
9 | """字符串排序。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example79(ExampleBase):
14 | def execute(self):
15 | s1 = 'hasdaffasdf'
16 | s2 = 'haaafasdfff'
17 | s3 = 'abcdeeee'
18 |
19 | ss = []
20 | ss.append(s1)
21 | ss.append(s2)
22 | ss.append(s3)
23 | print(sorted(ss))
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example24.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example24
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午12:07
8 |
9 | """有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example24(ExampleBase):
15 | def execute(self):
16 | a = 2
17 | b = 1
18 | result = 0.0
19 | for i in range(1,21):
20 | result = result + a/b
21 | a,b = a+b,a
22 | print(result)
23 |
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example7.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example7
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午4:57
8 |
9 | """将一个列表的数据复制到另一个列表中"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example7(ExampleBase):
14 | def execute(self):
15 | list1=[1,2,3,4,5,6,7,8,9]
16 | list2= None
17 | print('list1='+str(list1)+',list2='+str(list2))
18 | list2 = list1[:]
19 | print('After copy,list1=' + str(list1) + ',list2=' + str(list2))
20 |
21 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example87.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example87
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午10:31
8 |
9 | """回答结果(结构体变量传递)"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example87(ExampleBase):
14 | x = 0
15 | c = 0
16 |
17 | def execute(self):
18 | print(str(self.x) + ',' + str(self.c))
19 | self.fu()
20 | print(str(self.x) + ',' + str(self.c))
21 |
22 | def fu(self):
23 | self.x = 2
24 | self.c = 3
25 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example68.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example68
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 下午10:41
8 |
9 | """有n个整数,使其前面各数顺序向后移m个位置,最后m个数变成最前面的m个数"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example68(ExampleBase):
14 | def execute(self):
15 | data = [11,22,33,44,55,66,77,88,99]
16 | m = 16
17 | temp = []
18 | for i in range(0,m):
19 | d = data.pop()
20 | data.insert(0,d)
21 | print(data)
22 |
23 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example88.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example88
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午10:39
8 |
9 | """读取7个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example88(ExampleBase):
14 | def execute(self):
15 | for i in range(0, 7):
16 | num = input('请输入' + str(i) + '个整数:')
17 | if isinstance(int(num), int):
18 | print((int(num) * '*'))
19 | else:
20 | break
21 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example3.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example3
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/14 下午7:44
8 |
9 | """一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?"""
10 | from com.python100.example.files.ExampleBase import *
11 | import math
12 | class Example3(ExampleBase):
13 | def execute(self):
14 | x = 0
15 | for x in range(-100,10000):
16 | if (math.sqrt(x+100) == int(math.sqrt(x+100))) and (math.sqrt(x+268) == int(math.sqrt(x+268))):
17 | print('x='+str(x))
18 |
19 |
20 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example54.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example54
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午8:45
8 |
9 | """取一个整数a从右端开始的4〜7位。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example54(ExampleBase):
14 | def execute(self):
15 | a = input('请输入一个整数:')
16 | try:
17 | if isinstance(int(a),int):
18 | print(str(bin((int(a)>>4)&0x0F)))
19 | except Exception as e:
20 | print(e)
21 | self.execute()
22 |
23 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example93.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example93
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 上午9:24
8 |
9 | """时间函数举例3。"""
10 | from com.python100.example.files.ExampleBase import *
11 | import time
12 |
13 | class Example93(ExampleBase):
14 | def execute(self):
15 | start = time.clock()
16 | for i in range(0,10000):
17 | print(i,end='')
18 | end = time.clock()
19 | print('')
20 | print('start='+str(start)+',end='+str(end)+':end-start:%.4f'%(end-start))
21 |
22 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example11.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example11
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午6:10
8 |
9 | """古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,
10 | 小兔子长到第三个月后每个月又生一对兔子,
11 | 假如兔子都不死,问每个月的兔子总数为多少?"""
12 | from com.python100.example.files.ExampleBase import *
13 |
14 |
15 | class Example11(ExampleBase):
16 | def execute(self):
17 | f1 = 1
18 | f2 = 1
19 | for i in range(1, 22):
20 | print('%12ld %12ld' % (f1*2, f2*2),end='')
21 | f1 = f1 + f2
22 | f2 = f1 + f2
23 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example82.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example82
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午8:02
8 |
9 | """八进制转换为十进制"""
10 | from com.python100.example.files.ExampleBase import *
11 | import math
12 |
13 | class Example82(ExampleBase):
14 | def execute(self):
15 | print(ord('4'))
16 | num = input('请输入一个八进制数:')
17 | sum = 0
18 | index = 0
19 | for i in num[::-1]:
20 | sum = sum + int(i)*math.pow(8,index)
21 | index+=1
22 | print(str(sum))
23 |
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example27.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example27
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午1:13
8 |
9 | """利用递归函数调用方式,将所输入的5个字符,以相反顺序打印出来。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example27(ExampleBase):
14 | def execute(self):
15 | self.out(['a','b','c','d','e','f'],5)
16 |
17 | def out(self,a=[],index=int):
18 | if index == -1:
19 | return
20 | else:
21 | print(a[index])
22 | self.out(a,index-1)
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example35.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example35
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午4:14
8 |
9 | """文本颜色设置"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 | class Example35(ExampleBase):
13 | HEADER = '\033[95m'
14 | OKBLUE = '\033[94m'
15 | OKGREEN = '\033[92m'
16 | WARNING = '\033[93m'
17 | FAIL = '\033[91m'
18 | ENDC = '\033[0m'
19 | BOLD = '\033[1m'
20 | UNDERLINE = '\033[4m'
21 | def execute(self):
22 | print(self.OKGREEN+'OKGREEN'+self.ENDC)
23 |
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example36.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example36
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午4:18
8 |
9 | """求100之内的素数。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example36(ExampleBase):
14 | def execute(self):
15 | for i in range(2,101):
16 | f = True
17 | for j in range(2,int(i/2) +1):
18 | if i%j == 0:
19 | f = False
20 | break
21 | if f:
22 | print(i,end=',')
23 |
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example25.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example25
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午12:22
8 |
9 | """求1+2!+3!+...+20!的和"""
10 | from com.python100.example.files.ExampleBase import *
11 | from functools import reduce
12 | import math
13 |
14 |
15 | class Example25(ExampleBase):
16 | def execute(self):
17 | sum = 0
18 | for i in range(1,21):
19 | sum = sum + math.factorial(i)
20 | print(sum)
21 |
22 | def factorial(self,n):
23 | return reduce(lambda x,y:x*y,range(1,n+1))
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example78.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example78
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午5:08
8 |
9 | """找到年龄最大的人,并输出。请找出程序中有什么问题。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example78(ExampleBase):
14 | def execute(self):
15 | dic = {"a": 18, "b": 13, "c": 54, "d": 40}
16 | m = "a"
17 | for key in dic.keys():
18 | if dic.get(key) < dic.get(m):
19 | pass
20 | else:
21 | m = key
22 | print(m + ',' + str(dic.get(m)))
23 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example5.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example5
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午2:09
8 |
9 | """输入三个整数x,y,z,请把这三个数由小到大输出"""
10 | from com.python100.example.files.ExampleBase import *
11 | class Example5(ExampleBase):
12 | def execute(self):
13 | cout = 1
14 | inputs = []
15 | for i in range(1, 4):
16 | print('请输入第' + str(cout) + '个整数:')
17 | inputs.append(input())
18 | cout += 1
19 | inputs.sort()
20 | for value in inputs:
21 | print('从小到大输出:' + str(value))
22 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example97.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example97
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 下午5:37
8 |
9 | """从键盘输入一些字符,逐个把它们写到磁盘文件上,直到输入一个 # 为止"""
10 | from com.python100.example.files.ExampleBase import *
11 | from sys import stdout
12 |
13 | class Example97(ExampleBase):
14 | def execute(self):
15 | filename = input('请输入文件名:\n')
16 | fp = open(filename, "w")
17 | ch = input('输入字符串:\n')
18 | while ch != '#':
19 | fp.write(ch)
20 | #stdout.write(ch)
21 | ch = input('')
22 | fp.close()
23 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example28.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example28
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午2:05
8 |
9 | """有5个人坐在一起,问第五个人多少岁?
10 | 他说比第4个人大2岁。问第4个人岁数,
11 | 他说比第3个人大2岁。问第三个人,
12 | 又说比第2人大两岁。问第2个人,
13 | 说比第一个人大两岁。最后问第一个人,
14 | 他说是10岁。请问第五个人多大?"""
15 | from com.python100.example.files.ExampleBase import *
16 |
17 |
18 | class Example28(ExampleBase):
19 | def execute(self):
20 | print(self.age(5))
21 |
22 | def age(self, index=int):
23 | if index == 1:
24 | return 10
25 | else:
26 | return self.age(index - 1) + 2
27 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example29.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example29
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午2:30
8 |
9 | """给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example29(ExampleBase):
15 | def execute(self):
16 | number = input('请输入一个不多于5位数的正整数:')
17 | try:
18 | if isinstance(int(number), int):
19 | print('len:' + str(len(number)))
20 | print(number[::-1])
21 | except Exception as e:
22 | print(e)
23 | return self.execute()
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example100.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example100
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 下午5:38
8 |
9 | """两个列表转换为字典。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example100(ExampleBase):
14 | def execute(self):
15 | data1 = ['A', 'B', 'C', 'D', 'E', 'F']
16 | data2 = [90, 80, 70, 60, 50, 40]
17 | l = len(data1)
18 | if l < len(data2):
19 | pass
20 | else:
21 | l = len(data2)
22 | d = dict()
23 |
24 | for i in range(0, l):
25 | d[data1[i]] = data2[i]
26 |
27 | print(d)
28 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example56.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example56
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午8:58
8 |
9 | """画图,学用circle画圆形"""
10 | from com.python100.example.files.ExampleBase import *
11 | from tkinter import *
12 |
13 | class Example56(ExampleBase):
14 | def execute(self):
15 | canvas = Canvas(width=800, height=600, bg='yellow')
16 | canvas.pack(expand=YES, fill=BOTH)
17 | k = 1
18 | j = 1
19 | for i in range(0, 26):
20 | canvas.create_oval(310 - k, 250 - k, 310 + k, 250 + k, width=1)
21 | k += j
22 | j += 0.3
23 | mainloop()
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example21.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example21
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/18 下午10:31
8 |
9 | """猴子吃桃问题:猴子第一天摘下若干个桃子,
10 | 当即吃了一半,还不瘾,又多吃了一个第二天早
11 | 上又将剩下的桃子吃掉一半,又多吃了一个。
12 | 以后每天早上都吃了前一天剩下的一半零一个。
13 | 到第10天早上想再吃时,见只剩下一个桃子了。
14 | 求第一天共摘了多少"""
15 | from com.python100.example.files.ExampleBase import *
16 |
17 |
18 | class Example21(ExampleBase):
19 | def execute(self):
20 | total = 0
21 | for i in range(1, 11):
22 | if i == 1:
23 | total = total + 1
24 | else:
25 | total = 2 * (total + 1)
26 | print('total:' + str(total))
27 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example13.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example13
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午11:15
8 |
9 | """打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,
10 | 其各位数字立方和等于该数本身。
11 | 例如:153是一个"水仙花数",
12 | 因为153=1的三次方+5的三次方+3的三次方"""
13 | from com.python100.example.files.ExampleBase import *
14 | import math
15 |
16 | class Example13(ExampleBase):
17 | def execute(self):
18 | for i in range(100, 1000):
19 | b = int(i / 100)
20 | s = int((i % 100) / 10)
21 | g = int((i % 100) % 10)
22 | if (math.pow(b, 3) + math.pow(s, 3) + math.pow(g, 3)) == i:
23 | print(i, end=', ')
24 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example37.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example37
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午5:07
8 |
9 | """对10个数进行排序"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example37(ExampleBase):
15 | datas = []
16 |
17 | def execute(self):
18 | num = input('请输入第' + str(len(self.datas) + 1) + '个数:')
19 | if num.isdigit():
20 | self.datas.append(int(num))
21 | if len(self.datas) == 10:
22 | print(sorted(self.datas))
23 | else:
24 | self.execute()
25 | else:
26 | self.execute()
27 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example20.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example20
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/17 下午11:14
8 |
9 | """一球从100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第10次落地时,共经过多少米?第10次反弹多高?"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example20(ExampleBase):
15 | def execute(self):
16 | distance = 0
17 | H = 100
18 | for i in range(1, 11):
19 | if i == 1:
20 | distance = distance + H
21 | else:
22 | distance = distance + H
23 | H = H / 2
24 | print('distance:' + str(distance) + ',第10次反弹:' + str(H / 2))
25 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example83.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example83
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午8:14
8 |
9 | """求0—7所能组成的奇数个数"""
10 | from com.python100.example.files.ExampleBase import *
11 | import itertools
12 |
13 | class Example83(ExampleBase):
14 | def execute(self):
15 | result = []
16 | key = [0,1,2,3,4,5,6,7]
17 |
18 | for i in range(1,9):
19 | for j in itertools.permutations(key,i):
20 | if j[0]==0 or j[-1]==0 or j[-1]==2 or j[-1]==4 or j[-1]==6:
21 | #print(j)
22 | continue
23 | result.append(j)
24 | print(str(len(result)))
25 |
26 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example12.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example12
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午6:20
8 |
9 | """判断101-200之间有多少个素数,并输出所有素数"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example12(ExampleBase):
14 | def execute(self):
15 | total = 0
16 | for i in range(101, 200):
17 | isshuNumber = True
18 | for j in range(2, i):
19 | if (i % j) == 0:
20 | isshuNumber = False
21 | break
22 | if isshuNumber:
23 | total += 1
24 | print(' ' + str(i), end=',')
25 | print('total count = '+str(total))
--------------------------------------------------------------------------------
/com/python100/example/files/Example90.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example90
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 上午8:59
8 |
9 | """列表使用实例。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example90(ExampleBase):
14 | def execute(self):
15 | list = ['a','b','c','d','e','f']
16 | print('原始列表:'+str(list)+',长度:'+str(len(list)))
17 | list.append('元素')
18 | print('增加元素元素:' + str(list))
19 | list.pop(0)
20 | print('去掉第一个元素后:'+str(list))
21 | list.reverse()
22 | print('列表倒置后:'+str(list))
23 | print('元素的索引为:'+str(list.index('元素')))
24 | list.remove('元素')
25 | print('remove增加的元素后:'+str(list))
26 |
27 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example85.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example85
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午10:17
8 |
9 | """输入一个奇数,然后判断最少几个 9 除于该数的结果为整数。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example85(ExampleBase):
14 | def execute(self):
15 | print(float(str(('9'*8))))
16 | num = input('请输入一个奇数:')
17 | if isinstance(int(num), int):
18 | if int(num) % 2 == 1:
19 | count = 1
20 | while float('9' * count) % int(num) != 0:
21 | count += 1
22 | print(str(count))
23 | else:
24 | self.execute()
25 | else:
26 | self.execute()
27 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example44.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example44
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午7:16
8 |
9 | """两个 3 行 3 列的矩阵,实现其对应位置的数据相加,并返回一个新矩阵"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 | class Example44(ExampleBase):
14 | m1 = [
15 | [1, 2, 3],
16 | [4, 5, 6],
17 | [7, 8, 9]
18 | ]
19 | m2 = [
20 | [9, 8, 7],
21 | [6, 5, 4],
22 | [3, 2, 1]
23 | ]
24 | m3 = []
25 |
26 | def execute(self):
27 | for i in range(0, 3):
28 | m = []
29 | for j in range(0, 3):
30 | m.append(self.m1[i][j] + self.m2[i][j])
31 | self.m3.append(m)
32 | print(self.m3)
33 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example99.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example99
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 下午5:38
8 |
9 | """有两个磁盘文件A和B,各存放一行字母,要求把这两个文件中的信息合并(按字母顺序排列), 输出到一个新文件C中。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example99(ExampleBase):
14 | def execute(self):
15 | fp1 = open('testfile/A', 'r')
16 | result1 = fp1.read()
17 | fp1.close()
18 | fp2 = open('testfile/B', 'r')
19 | result2 = fp2.read()
20 | fp2.close()
21 | result = result1 + result2
22 | result = ''.join(sorted(result))
23 | fp = open('testfile/C', 'w')
24 | fp.write(result)
25 | fp.close()
26 | print('处理完毕,请查看testfile/C文件!')
27 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example69.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example69
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 下午10:49
8 |
9 | """有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example69(ExampleBase):
14 | def execute(self):
15 | data = []
16 | for i in range(1, 10):
17 | data.append(i)
18 | print(data)
19 | num = 0
20 | while (len(data) != 1):
21 | if num == 3:
22 | num = 0
23 | data.pop(0)
24 | else:
25 | num = num + 1
26 | value = data.pop(0)
27 | data.append(value)
28 | print(data)
29 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example46.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example46
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午10:44
8 |
9 | """求输入数字的平方,如果平方运算后小于 50 则退出"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 | import math
13 |
14 | class Example46(ExampleBase):
15 | def execute(self):
16 | num = input('请输入一个数字:')
17 | try:
18 | if isinstance(float(num), float) or isinstance(int(num), int):
19 | result = math.pow(float(num), 2)
20 | if result < 50:
21 | exit(0)
22 | else:
23 | print(result)
24 | else:
25 | self.execute()
26 | except Exception as e:
27 | print(e)
28 | self.execute()
29 |
30 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example15.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example15
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午11:35
8 |
9 | """利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example15(ExampleBase):
14 | def execute(self):
15 | score = input('请输入学习成绩:')
16 | try:
17 | if isinstance(int(score), int):
18 | if int(score) >= 90:
19 | print('A')
20 | elif int(score) >= 60:
21 | print('B')
22 | else:
23 | print('C')
24 | else:
25 | self.execute()
26 | except ValueError as e:
27 | print(e)
28 | self.execute()
--------------------------------------------------------------------------------
/com/python100/example/files/Example76.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example76
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午12:51
8 |
9 | """编写一个函数,输入n为偶数时,调用函数求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/n"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example76(ExampleBase):
14 | def execute(self):
15 | n = input('请输入n:')
16 | self.sum(int(n))
17 |
18 | def sum(self, n):
19 | sum = 0.0
20 | for i in range(1, int((n + 1) / 2)+1):
21 | if n % 2 == 0:
22 | sum += 1.0 /( 2 * i)
23 | #print('+'+str(1)+'/'+str(2*i),end='')
24 | else:
25 | sum = 1.0 / (2 * i - 1)
26 | #print('+' + str(1) + '/' + str(2 * i - 1),end='')
27 | print(sum)
28 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example89.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example89
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午10:54
8 |
9 | """某个公司采用公用电话传递数据,数据
10 | 是四位的整数,在传递过程中是加密的,加
11 | 密规则如下:每位数字都加上5,然后用和除
12 | 以10的余数代替该数字,再将第一位和第四
13 | 位交换,第二位和第三位交换。"""
14 | from com.python100.example.files.ExampleBase import *
15 |
16 |
17 | class Example89(ExampleBase):
18 | def execute(self):
19 | num = input('请输入四位整数:')
20 | if isinstance(int(num),int) and len(num) == 4:
21 | temp = []
22 | for i in num:
23 | temp.append(str((int(i)+5)%10))
24 | temp[0],temp[len(temp)-1]=temp[len(temp)-1],temp[0]
25 | temp[1],temp[2]=temp[2],temp[1]
26 | print(''.join(temp))
27 | else:
28 | self.execute()
29 |
30 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example30.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example30
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午2:49
8 |
9 | """一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example30(ExampleBase):
14 | def execute(self):
15 | number = input('请输入一个5位数:')
16 | try:
17 | if isinstance(int(number), int):
18 | if len(number) == 5:
19 | if number[0] == number[-1] and number[1] == number[-2]:
20 | print(number + '是回文数')
21 | else:
22 | print(number + '不是回文数')
23 | else:
24 | raise Exception('请输入五位长度')
25 | except Exception as e:
26 | print(e)
27 | self.execute()
28 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example81.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example81
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午7:42
8 |
9 | """809*??=800*??+9*?? 其中??代表的两位数,
10 | 809*??为四位数,8*??的结果为两位数,9*??的
11 | 结果为3位数。求??代表的两位数,及809*??后的结果。"""
12 | from com.python100.example.files.ExampleBase import *
13 | import math
14 |
15 |
16 | class Example81(ExampleBase):
17 | def execute(self):
18 | for ii in range(10, 100):
19 | if 4 == self.calL(809 * ii) and self.calL(8 * ii) == 2 and self.calL(9 * ii) == 3:
20 | print(ii)
21 | print(809 * ii)
22 |
23 | """判断一个数字是1-4中的几位数"""
24 | def calL(self, num):
25 | temp = 1
26 | for i in range(4, 0, -1):
27 | temp = i
28 | if int(num / math.pow(10, i - 1)) > 0:
29 | break
30 | return temp
31 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example38.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example38
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午5:23
8 |
9 | """求一个3*3矩阵主对角线元素之和"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example38(ExampleBase):
14 | datas = []
15 |
16 | def execute(self):
17 | self.datas.clear()
18 | for i in range(0, 3):
19 | data = []
20 | for j in range(0, 3):
21 | num = input('请输入第' + str((3 * i) + j + 1) + '个数:')
22 | if num.isdigit():
23 | data.append(int(num))
24 | else:
25 | print('输入数据格式异常,请重新执行')
26 | exit(-1)
27 | self.datas.append(data)
28 | sum = 0
29 | for k in range(0, 3):
30 | sum = sum + self.datas[k][k]
31 | print(sum)
32 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example17.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example17
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/17 下午10:36
8 |
9 | """输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 | class Example17(ExampleBase):
13 | def execute(self):
14 | ss = input('请输入一行字符:')
15 | char = 0
16 | space = 0
17 | number = 0
18 | other = 0
19 |
20 | for s in ss:
21 | # s.isalpha()
22 | if s == ' ':
23 | space+=1
24 | elif (s >= 'a' and s<= 'z') or (s >= 'A' and s<= 'Z') or('\u4e00' <= s <= '\u9fff'):
25 | char+=1
26 | elif s>='0' and s<='9' :
27 | number+=1
28 | else:
29 | other+=1
30 | print('字母='+str(char)+',空格='+str(space)+',数字='+str(number)+',其它='+str(other))
--------------------------------------------------------------------------------
/com/python100/example/files/Example48.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example48
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午11:12
8 |
9 | """数字比较"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 | class Example48(ExampleBase):
14 | def execute(self):
15 | num1 = input('请输入第1个数:')
16 | num2 = input('请输入第2个数:')
17 | try:
18 | if isinstance(float(num1), float) and isinstance(float(num2), float):
19 | if float(num1) < float(num2):
20 | print(str(num1) + '<' + str(num2))
21 | elif float(num1) == float(num2):
22 | print(str(num1) + '==' + str(num2))
23 | else:
24 | print(str(num1) + '>' + str(num2))
25 | else:
26 | self.execute()
27 | except Exception as e:
28 | print(e)
29 | self.execute()
30 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example23.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example23
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 上午9:02
8 |
9 | """打印出如下图案(菱形):
10 | *
11 | ***
12 | *****
13 | *******
14 | *****
15 | ***
16 | *
17 | """
18 | from com.python100.example.files.ExampleBase import *
19 |
20 |
21 | class Example23(ExampleBase):
22 | def execute(self):
23 | lines = input('请输入要打印的行数:')
24 | try:
25 | if isinstance(int(lines), int):
26 | for i in range(0, int(lines)):
27 | number = 0;
28 | if i < int(lines) / 2:
29 | number = 2 * i + 1
30 | else:
31 | number = 2 * (int(lines) - i - 1) + 1
32 | print(int((int(lines) - number) / 2) * ' ' + number * '*' + int((int(lines) - number) / 2) * ' ')
33 | except:
34 | self.execute()
35 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example6.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example6
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午3:46
8 |
9 | """斐波那契数列:0、1、1、2、3、5、8、13、21、34...输出"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example6(ExampleBase):
14 | fbl=[]
15 |
16 | def execute(self):
17 | self.fbl.clear()
18 | i = 0
19 | for k in range(1, 100):
20 | self.outputFbn(i)
21 | i += 1
22 | print(self.fbl)
23 |
24 | def outputFbn(self, i):
25 | if i == 0:
26 | self.fbl.append(0)
27 | elif i == 1:
28 | self.fbl.append(1)
29 | elif i == 2:
30 | self.fbl.append(1)
31 | else:
32 | j = self.fbl[len(self.fbl) - 1:len(self.fbl) - 1 - 1:-1][0]
33 | k = self.fbl[len(self.fbl) - 1 - 1:len(self.fbl) - 1 - 1 - 1:-1][0]
34 | self.fbl.append((j + k))
35 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example16.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example16
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/17 下午10:32
8 |
9 | """输出指定格式的日期"""
10 | from com.python100.example.files.ExampleBase import *
11 | import datetime
12 |
13 |
14 | class Example16(ExampleBase):
15 | def execute(self):
16 | # 输出今日日期,格式为 dd/mm/yyyy。更多选项可以查看 strftime() 方法
17 | print(datetime.date.today().strftime('%d/%m/%Y'))
18 |
19 | # 创建日期对象
20 | miyazakiBirthDate = datetime.date(1941, 1, 5)
21 |
22 | print(miyazakiBirthDate.strftime('%d/%m/%Y'))
23 |
24 | # 日期算术运算
25 | miyazakiBirthNextDay = miyazakiBirthDate + datetime.timedelta(days=1)
26 |
27 | print(miyazakiBirthNextDay.strftime('%d/%m/%Y'))
28 |
29 | # 日期替换
30 | miyazakiFirstBirthday = miyazakiBirthDate.replace(year=miyazakiBirthDate.year + 1)
31 |
32 | print(miyazakiFirstBirthday.strftime('%d/%m/%Y'))
33 |
34 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example67.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example67
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 下午10:20
8 |
9 | """输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example67(ExampleBase):
14 | def execute(self):
15 | data = []
16 | for i in range(0, 6):
17 | k = input('请输入数字:')
18 | data.append(int(k))
19 | maxIndex = 0
20 | temp = data[0]
21 | for i in range(1, len(data) - 1):
22 | if temp < data[i]:
23 | temp = data[i]
24 | maxIndex = i
25 | data[0], data[maxIndex] = temp, data[0]
26 | minIndex = 0
27 | temp = data[0]
28 | for i in range(1, len(data) - 1):
29 | if temp > data[i]:
30 | temp = data[i]
31 | minIndex = i
32 | data[-1], data[minIndex] = temp, data[-1]
33 | print(data)
34 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example1.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example_1
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/14 下午12:47
8 |
9 | """题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example1(ExampleBase):
15 | results = []
16 |
17 | def execute(self):
18 | self.results.clear()
19 | for i in range(1, 5):
20 | for j in range(1, 5):
21 | if i == j:
22 | continue
23 | for k in range(1, 5):
24 | if j == k:
25 | continue
26 | if i == k:
27 | continue
28 | self.results.append(i * 100 + j * 10 + k)
29 | totalcout = 0
30 | #print('results:'+str(self.results))
31 | for r in self.results:
32 | totalcout = totalcout + 1
33 | print('第' + str(totalcout) + '个数是:' + str(r))
--------------------------------------------------------------------------------
/com/python100/example/files/Example80.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example80
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/21 下午5:19
8 |
9 | """海滩上有一堆桃子,五只猴子来分。
10 | 第一只猴子把这堆桃子平均分为五份,
11 | 多了一个,这只猴子把多的一个扔入海中,
12 | 拿走了一份。第二只猴子把剩下的桃子又平均
13 | 分成五份,又多了一个,它同样把多的一个扔入
14 | 海中,拿走了一份,第三、第四、第五只猴子都
15 | 是这样做的,问海滩上原来最少有多少个桃子?"""
16 | from com.python100.example.files.ExampleBase import *
17 |
18 |
19 | class Example80(ExampleBase):
20 | def execute(self):
21 | n = 6 # 假设第五次分之前有6个桃子
22 | result = []
23 | while True:
24 | result.clear()
25 | temp = n
26 | v = True
27 | for i in range(0, 5):
28 | if (temp - 1) % 5 == 0:
29 | result.append(temp)
30 | temp = temp - 1 - (temp - 1) / 5
31 | else:
32 | v = False
33 | break
34 | if v:
35 | break
36 | n += 1
37 | print(result)
38 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example71.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example71
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 下午11:35
8 |
9 | """编写input()和output()函数输入,输出5个学生的数据记录"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example71(ExampleBase):
14 | result = []
15 | def execute(self):
16 | for i in range(0,3):
17 | self.inputInfo()
18 | self.outputInfo()
19 |
20 | def inputInfo(self):
21 | num = input('请输入学生学号:')
22 | name = input('请输入学生姓名:')
23 | score = []
24 | for i in range(1,4):
25 | s = input('请输入分数'+str(i)+':')
26 | score.append(s)
27 | self.result.append([num,name,score])
28 |
29 | def outputInfo(self):
30 | for i in range(0,3):
31 | print('学生'+str(i+1)+'的学号:'+self.result[i][0])
32 | print('学生'+str(i+1)+'的姓名:'+self.result[i][1])
33 | print('学生'+str(i+1)+'的分数:'+str(self.result[i][2]))
34 |
35 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example61.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example61
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/20 上午9:34
8 |
9 | """打印出杨辉三角形(要求打印出10行如下图)"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 |
13 | class Example61(ExampleBase):
14 | def execute(self):
15 | data = []
16 | for i in range(0, 10):
17 | d = []
18 | if i == 0:
19 | d.append(1)
20 | data.append(d)
21 | elif i == 1:
22 | d.append(1)
23 | d.append(1)
24 | data.append(d)
25 | else:
26 | for j in range(0, i + 1):
27 | if j == 0:
28 | d.append(1)
29 | elif j == i:
30 | d.append(1)
31 | else:
32 | d.append(data[i - 1][j - 1] + data[i - 1][j])
33 | data.append(d)
34 | print(data, end='\n')
35 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example39.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example39
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午6:07
8 |
9 | """有一个已经排好序的数组。现输入一个数,要求按原来的规律将它插入数组中"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example39(ExampleBase):
15 | datas = [9, 8, 7, 5, 4, 3, 2, 1]
16 |
17 | def execute(self):
18 | num = input('请输入一个数:')
19 | # 默认顺序由低到高排列
20 | order = False
21 | if num.isdigit():
22 | if self.datas[0] < self.datas[-1]:
23 | pass
24 | else:
25 | order = True
26 | for j in range(0, len(self.datas) - 1):
27 | if order:
28 | if int(num) >= self.datas[j]:
29 | self.datas.insert(j, int(num))
30 | break
31 | else:
32 | if int(num) <= self.datas[j]:
33 | self.datas.insert(j, int(num))
34 | break
35 | print(self.datas)
36 | else:
37 | print('输入数据格式异常')
38 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example22.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example22
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/18 下午10:44
8 |
9 | """两个乒乓球队进行比赛,各出三人。
10 | 甲队为a,b,c三人,乙队为x,y,z三人。
11 | 已抽签决定比赛名单。有人向队员打听
12 | 比赛的名单。a说他不和x比,c说他不
13 | 和x,z比,请编程序找出三队赛手的名单"""
14 | from com.python100.example.files.ExampleBase import *
15 | import itertools
16 |
17 | class Example22(ExampleBase):
18 |
19 | def execute(self):
20 | A = ['a', 'b', 'c']
21 | B = ['x', 'y', 'z']
22 | result1 = list(itertools.product(A, B))
23 | result2 = list(itertools.combinations(result1, 3))
24 |
25 | for i in range(0, len(result2)):
26 | value = result2[i]
27 | result3 = set()
28 | for k in range(0, len(value)):
29 | if ((value[k][0] == 'a') and value[k][1] == 'x') or (
30 | ((value[k][0] == 'c') and (value[k][1] == 'x') or (value[k][0] == 'c') and value[k][1] == 'z')):
31 | pass
32 | else:
33 | result3.add(value[k][0])
34 | result3.add(value[k][1])
35 | if len(result3) == len(A) + len(B):
36 | print(value)
37 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example31.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example31
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/19 下午2:59
8 |
9 | """输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续判断第二个字母"""
10 |
11 | from com.python100.example.files.ExampleBase import *
12 |
13 |
14 | class Example31(ExampleBase):
15 | WEEK=[('MON','星期一'),('TUS','星期二'),('WEN','星期三'),('THR','星期四'),('FRI','星期五'),('SAT','星期六'),('SUN','星期日')]
16 | cache=''
17 | def execute(self):
18 | day = input('请输入星期几的第' + str(len(self.cache) + 1) + '一个字母:')
19 | try:
20 | if str.isalpha(day):
21 | self.cache = self.cache + day.upper()
22 | result = []
23 | for DAY in self.WEEK:
24 | if str(DAY[0]).startswith(str.upper(self.cache)):
25 | result.append(DAY)
26 | if len(result) > 1:
27 | self.execute()
28 | elif len(result) == 1:
29 | print('' + str(result[0][1]))
30 | else:
31 | self.cache = ''
32 | self.execute()
33 | else:
34 | raise Exception('请输入字母')
35 |
36 | except Exception as e:
37 | print(e)
38 | self.execute()
39 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example14.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example14
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/15 下午11:29
8 |
9 | """将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 | class Example14(ExampleBase):
13 | result = []
14 |
15 | def execute(self):
16 | n = input('请输入一个整数:')
17 | if not isinstance(int(n), int):
18 | print('输入错误,请重新输入')
19 | self.execute()
20 | return
21 | self.result.clear()
22 | self.caculate(int(n))
23 | for pos in range(0,len(self.result)):
24 | if pos == len(self.result)-1:
25 | print(''+str(self.result[pos]))
26 | else:
27 | print('' + str(self.result[pos]),end='*')
28 |
29 | def caculate(self, n):
30 | for i in range(2, n + 1):
31 | isshuNumber = True
32 | for j in range(2, i):
33 | if (i % j) == 0:
34 | isshuNumber = False
35 | break
36 | if isshuNumber and n % i == 0:
37 | self.result.append(i)
38 | #print('n='+str(n)+',i='+str(i))
39 | if int(n / i) != 1:
40 | self.caculate(int(n / i))
41 | break
42 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example18.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example18
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/17 下午10:50
8 |
9 | """求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字。
10 | 例如2+22+222+2222+22222(此时共有5个数相加),
11 | 几个数相加由键盘控制。"""
12 | from com.python100.example.files.ExampleBase import *
13 |
14 |
15 | class Example18(ExampleBase):
16 |
17 | def execute(self):
18 | num = input('请输入要加的数字:')
19 | result = 0
20 | if self.isInt(num):
21 | r = self.inputCount()
22 | for i in range(1, r + 1):
23 | result = result + int(num * i)
24 | if i == r:
25 | print('' + str(num * i), end='=')
26 | print('' + str(result))
27 | else:
28 | print('' + str(num * i), end='+')
29 |
30 | else:
31 | self.execute()
32 |
33 | def inputCount(self):
34 | count = input('请输入要加的次数:')
35 | if self.isInt(count) and int(count) > 0:
36 | return int(count)
37 | else:
38 | return self.inputCount()
39 |
40 | def isInt(self, n):
41 | try:
42 | if isinstance(int(n), int):
43 | return True
44 | else:
45 | return False
46 | except:
47 | return False
48 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example94.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example94
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/22 下午5:37
8 |
9 | """时间函数举例4,一个猜数游戏,判断一个人反应快慢。"""
10 | from com.python100.example.files.ExampleBase import *
11 | import random
12 | import time
13 |
14 | class Example94(ExampleBase):
15 | targetN = 0
16 |
17 | msg = '请输入(1-100)之间的一个整数:'
18 |
19 | def execute(self):
20 | self.targetN = int(100 * random.random())
21 | start = time.time()
22 | self.msg = '请输入(1-100)之间的一个整数:'
23 | while True:
24 | if self.guess() == True:
25 | break
26 | print('恭喜您,猜对啦~' + str(self.targetN))
27 | print('您总共耗时:' + str(time.time() - start))
28 |
29 | def guess(self):
30 | number = input(self.msg)
31 | try:
32 | if isinstance(int(number), int):
33 | if int(number) == self.targetN:
34 | return True
35 | elif int(number) > self.targetN:
36 | self.msg = '请输入比' + number + '小的一个整数:'
37 | return False
38 | else:
39 | self.msg = '请输入比' + number + '大的一个整数:'
40 | return False
41 | else:
42 | return False
43 | except Exception as e:
44 | print(e)
45 | return False
46 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example2.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example2
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/14 下午2:04
8 |
9 | """企业发放的奖金根据利润提成。
10 | 利润(I)低于或等于10万元时,奖金可提10%;
11 | 利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;
12 | 20万到40万之间时,高于20万元的部分,可提成5%;
13 | 40万到60万之间时高于40万元的部分,可提成3%;
14 | 60万到100万之间时,高于60万元的部分,可提成1.5%,
15 | 高于100万元时,超过100万元的部分按1%提成,
16 | 从键盘输入当月利润I,求应发放奖金总数?"""
17 |
18 | from com.python100.example.files.ExampleBase import *
19 |
20 |
21 | class Example2(ExampleBase):
22 | def execute(self):
23 | gain = 0 # 提成
24 | # rate = float(input("Please input your 利润:"))
25 | # if rate <= 10:
26 | # gain = rate * 0.1
27 | # elif (rate < 20):
28 | # gain = rate * 0.075
29 | # elif (rate < 40):
30 | # gain = rate * 0.05
31 | # elif (rate < 60):
32 | # gain = rate * 0.03
33 | # elif (rate < 100):
34 | # gain = rate * 0.015
35 | # else:
36 | # gain = rate * 0.01
37 | # print('gain=' + str(gain))
38 | i = float(input('净利润:'))
39 | arr = [1000000, 600000, 400000, 200000, 100000, 0]
40 | rat = [0.01, 0.015, 0.03, 0.05, 0.075, 0.1]
41 | r = 0
42 | for idx in range(0, 6):
43 | if i > arr[idx]:
44 | r += (i - arr[idx]) * rat[idx]
45 | #print(i - arr[idx]) * rat[idx]
46 | i = arr[idx]
47 | print('r='+str(r))
48 |
--------------------------------------------------------------------------------
/com/python100/example/files/Example4.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python3.5
2 | # -*- coding: utf-8 -*-
3 | # Project: Python100example
4 | # File: Example4
5 | # Author: liyaoyan
6 | # Email: helloalvin@163.com
7 | # Time: 2018/10/14 下午7:58
8 |
9 | """输入某年某月某日,判断这一天是这一年的第几天?"""
10 | from com.python100.example.files.ExampleBase import *
11 |
12 | class Example4(ExampleBase):
13 | def execute(self):
14 | date = input('请输入某年某月某日,(例如:20181014):')
15 | #判断输入是否合法
16 | if len(date)!= 8:
17 | print('请输入正确格式')
18 | self.execute()
19 | return
20 | year_input = ''
21 | month_input = ''
22 | day_input = ''
23 | index = 0
24 | for c in date:
25 | if index < 4:
26 | year_input = year_input + c
27 | elif index < 6:
28 | month_input = month_input + c
29 | else:
30 | day_input = day_input + c
31 | index += 1
32 | year = int(year_input)
33 | month = int(month_input)
34 | day = int(day_input)
35 |
36 | leap = False
37 |
38 | if year % 400 == 0:
39 | leap = True
40 | elif year % 100 == 0:
41 | pass
42 | elif year % 4 == 0:
43 | leap = True
44 |
45 | month2day = 29 if leap else 28
46 | if leap :
47 | print('this year '+str(year) +' is leap year,month2day='+ str(month2day))
48 | else:
49 | print('this year ' + str(year) + ' is not leap year,month2day=' + str(month2day))
50 |
51 | days = [31,month2day,31,30,31,30,31,31,30,31,30]
52 | indexday = 0
53 | if month == 1:
54 | print('input date '+date+' is the '+str(day)+' day')
55 | else:
56 | for k in range(0,month-1):
57 | indexday = indexday + days[k]
58 | indexday+= day
59 | print('input date ' + date + ' is the ' + str(indexday) + ' day')
--------------------------------------------------------------------------------
/read.txt:
--------------------------------------------------------------------------------
1 | 内含100例python实例,全为自己编写,在python3.5环境下调试通过
2 |
3 |
4 | 示例:
5 | 主入口:com.python100.example.main.Main.py
6 |
7 | 如若调试哪一个示例,只需在Main.py打开对应示例的注释即可。
8 |
9 | 1.题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少
10 | 实现类:com.python100.example.files.Example1
11 |
12 | 2.企业发放的奖金根据利润提成。
13 | 利润(I)低于或等于10万元时,奖金可提10%;
14 | 利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;
15 | 20万到40万之间时,高于20万元的部分,可提成5%;
16 | 40万到60万之间时高于40万元的部分,可提成3%;
17 | 60万到100万之间时,高于60万元的部分,可提成1.5%,
18 | 高于100万元时,超过100万元的部分按1%提成,
19 | 从键盘输入当月利润I,求应发放奖金总数?
20 | 实现类: com.python100.example.files.Example2
21 |
22 | 3.一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
23 | 实现类: com.python100.example.files.Example3
24 |
25 | 4.输入某年某月某日,判断这一天是这一年的第几天?
26 | 实现类: com.python100.example.files.Example4
27 |
28 | 5.输入三个整数x,y,z,请把这三个数由小到大输出
29 | 实现类: com.python100.example.files.Example5
30 |
31 | 6.斐波那契数列:0、1、1、2、3、5、8、13、21、34...输出
32 | 实现类: com.python100.example.files.Example6
33 |
34 | 7.将一个列表的数据复制到另一个列表中
35 | 实现类: com.python100.example.files.Example7
36 |
37 | 8.输出 9*9 乘法口诀表
38 | 实现类: com.python100.example.files.Example8
39 |
40 | 9.暂停一秒输出。
41 | 实现类: com.python100.example.files.Example9
42 |
43 | 10.暂停一秒输出,并格式化当前时间
44 | 实现类: com.python100.example.files.Example10
45 |
46 | 11.古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,
47 | 小兔子长到第三个月后每个月又生一对兔子,
48 | 假如兔子都不死,问每个月的兔子总数为多少?
49 | 实现类: com.python100.example.files.Example11
50 |
51 | 12.判断101-200之间有多少个素数,并输出所有素数
52 | 实现类: com.python100.example.files.Example12
53 |
54 | 13.打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,
55 | 其各位数字立方和等于该数本身。
56 | 例如:153是一个"水仙花数",
57 | 因为153=1的三次方+5的三次方+3的三次方
58 | 实现类: com.python100.example.files.Example13
59 |
60 | 14.将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5
61 | 实现类: com.python100.example.files.Example14
62 |
63 | 15.利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示
64 | 实现类: com.python100.example.files.Example15
65 |
66 | 16.输出指定格式的日期
67 | 实现类: com.python100.example.files.Example16
68 |
69 | 17.输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数
70 | 实现类: com.python100.example.files.Example17
71 |
72 | 18.求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字。
73 | 例如2+22+222+2222+22222(此时共有5个数相加),
74 | 几个数相加由键盘控制。
75 | 实现类: com.python100.example.files.Example18
76 |
77 | 19.一个数如果恰好等于它的因子之和,这个数就称为"完数"。例如6=1+2+3.编程找出1000以内的所有完数。
78 | 实现类: com.python100.example.files.Example19
79 |
80 | 20.一球从100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第10次落地时,共经过多少米?第10次反弹多高?
81 | 实现类: com.python100.example.files.Example20
82 |
83 | 21.猴子吃桃问题:猴子第一天摘下若干个桃子,
84 | 当即吃了一半,还不瘾,又多吃了一个第二天早
85 | 上又将剩下的桃子吃掉一半,又多吃了一个。
86 | 以后每天早上都吃了前一天剩下的一半零一个。
87 | 到第10天早上想再吃时,见只剩下一个桃子了。
88 | 求第一天共摘了多少
89 | 实现类: com.python100.example.files.Example21
90 |
91 | 22.两个乒乓球队进行比赛,各出三人。
92 | 甲队为a,b,c三人,乙队为x,y,z三人。
93 | 已抽签决定比赛名单。有人向队员打听
94 | 比赛的名单。a说他不和x比,c说他不
95 | 和x,z比,请编程序找出三队赛手的名单
96 | 实现类: com.python100.example.files.Example22
97 |
98 | 23.打印出如下图案(菱形):
99 | *
100 | ***
101 | *****
102 | *******
103 | *****
104 | ***
105 | *
106 | 实现类: com.python100.example.files.Example23
107 |
108 | 24.有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。
109 | 实现类: com.python100.example.files.Example24
110 |
111 | 25.求1+2!+3!+...+20!的和
112 | 实现类: com.python100.example.files.Example25
113 |
114 | 26.利用递归方法求5!
115 | 实现类: com.python100.example.files.Example26
116 |
117 | 27.利用递归函数调用方式,将所输入的5个字符,以相反顺序打印出来。
118 | 实现类: com.python100.example.files.Example27
119 |
120 | 28.5个人坐在一起,问第五个人多少岁?
121 | 他说比第4个人大2岁。问第4个人岁数,
122 | 他说比第3个人大2岁。问第三个人,
123 | 又说比第2人大两岁。问第2个人,
124 | 说比第一个人大两岁。最后问第一个人,
125 | 他说是10岁。请问第五个人多大?
126 | 实现类: com.python100.example.files.Example28
127 |
128 | 29.给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字
129 | 实现类: com.python100.example.files.Example29
130 |
131 | 30.一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。
132 | 实现类: com.python100.example.files.Example30
133 |
134 | 31.输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续判断第二个字母
135 | 实现类: com.python100.example.files.Example31
136 |
137 | 32.按相反的顺序输出列表的值
138 | 实现类: com.python100.example.files.Example32
139 |
140 | 33.按逗号分隔列表
141 | 实现类: com.python100.example.files.Example33
142 |
143 | 34.练习函数调用。
144 | 实现类: com.python100.example.files.Example34
145 |
146 | 35.文本颜色设置
147 | 实现类: com.python100.example.files.Example35
148 |
149 | 36.求100之内的素数。
150 | 实现类: com.python100.example.files.Example36
151 |
152 | 37.对10个数进行排序
153 | 实现类: com.python100.example.files.Example37
154 |
155 | 38.求一个3*3矩阵主对角线元素之和
156 | 实现类: com.python100.example.files.Example38
157 |
158 | 39.有一个已经排好序的数组。现输入一个数,要求按原来的规律将它插入数组中
159 | 实现类: com.python100.example.files.Example39
160 |
161 | 40.将一个数组逆序输出
162 | 实现类: com.python100.example.files.Example40
163 |
164 | 41.模仿静态变量的用法
165 | 实现类: com.python100.example.files.Example41
166 |
167 | 42.学习使用auto定义变量的用法
168 | 实现类: com.python100.example.files.Example42
169 |
170 | 43.模仿静态变量(static)另一案例。
171 | 实现类: com.python100.example.files.Example43
172 |
173 | 44.两个 3 行 3 列的矩阵,实现其对应位置的数据相加,并返回一个新矩阵
174 | 实现类: com.python100.example.files.Example44
175 |
176 | 45.统计 1 到 100 之和
177 | 实现类: com.python100.example.files.Example45
178 |
179 | 46.求输入数字的平方,如果平方运算后小于 50 则退出
180 | 实现类: com.python100.example.files.Example46
181 |
182 | 47.两个变量值互换。
183 | 实现类: com.python100.example.files.Example47
184 |
185 | 48.数字比较
186 | 实现类: com.python100.example.files.Example48
187 |
188 | 49.使用lambda来创建匿名函数
189 | 实现类: com.python100.example.files.Example49
190 |
191 | 50.输出一个随机数。
192 | 实现类: com.python100.example.files.Example50
193 |
194 | 51.学习使用按位与 &
195 | 实现类: com.python100.example.files.Example51
196 |
197 | 52.学习使用按位或 |
198 | 实现类: com.python100.example.files.Example52
199 |
200 | 53.学习使用按位异或 ^
201 | 实现类: com.python100.example.files.Example53
202 |
203 | 54.取一个整数a从右端开始的4〜7位
204 | 实现类: com.python100.example.files.Example54
205 |
206 | 55.学习使用按位取反~
207 | 实现类: com.python100.example.files.Example55
208 |
209 | 56.画图,学用circle画圆形
210 | 实现类: com.python100.example.files.Example56
211 |
212 | 57.画图,学用line画直线
213 | 实现类: com.python100.example.files.Example57
214 |
215 | 58.画图,学用rectangle画方形
216 | 实现类: com.python100.example.files.Example58
217 |
218 | 59.画图,综合例子
219 | 实现类: com.python100.example.files.Example59
220 |
221 | 60.计算字符串长度
222 | 实现类: com.python100.example.files.Example60
223 |
224 | 61.打印出杨辉三角形(要求打印出10行如下图)
225 | 实现类: com.python100.example.files.Example61
226 |
227 | 62.查找字符串
228 | 实现类: com.python100.example.files.Example62
229 |
230 | 63.省略
231 |
232 | 64.省略
233 |
234 | 65.省略
235 |
236 | 66.输入3个数a,b,c,按大小顺序输出。
237 | 实现类: com.python100.example.files.Example66
238 |
239 | 67.输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组
240 | 实现类: com.python100.example.files.Example67
241 |
242 | 68.有n个整数,使其前面各数顺序向后移m个位置,最后m个数变成最前面的m个数
243 | 实现类: com.python100.example.files.Example68
244 |
245 | 69.有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。
246 | 实现类: com.python100.example.files.Example69
247 |
248 | 70.写一个函数,求一个字符串的长度,在main函数中输入字符串,并输出其长度。
249 | 实现类: com.python100.example.files.Example70
250 |
251 | 71.编写input()和output()函数输入,输出5个学生的数据记录
252 | 实现类: com.python100.example.files.Example72
253 |
254 | 72.创建一个链表
255 | 实现类: com.python100.example.files.Example73
256 |
257 | 73.反向输出一个链表
258 | 实现类: com.python100.example.files.Example74
259 |
260 | 74.列表排序及连接
261 | 实现类: com.python100.example.files.Example75
262 |
263 | 75.放松一下,算一道简单的题目
264 | 实现类: com.python100.example.files.Example76
265 |
266 | 76.编写一个函数,输入n为偶数时,调用函数求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/n
267 | 实现类: com.python100.example.files.Example77
268 |
269 | 77.循环输出列表
270 | 实现类: com.python100.example.files.Example77
271 |
272 | 78.找到年龄最大的人,并输出。请找出程序中有什么问题。
273 | 实现类: com.python100.example.files.Example78
274 |
275 | 79.字符串排序
276 | 实现类: com.python100.example.files.Example79
277 |
278 | 80.海滩上有一堆桃子,五只猴子来分。
279 | 第一只猴子把这堆桃子平均分为五份,
280 | 多了一个,这只猴子把多的一个扔入海中,
281 | 拿走了一份。第二只猴子把剩下的桃子又平均
282 | 分成五份,又多了一个,它同样把多的一个扔入
283 | 海中,拿走了一份,第三、第四、第五只猴子都
284 | 是这样做的,问海滩上原来最少有多少个桃子?
285 | 实现类: com.python100.example.files.Example80
286 |
287 | 81.809*??=800*??+9*?? 其中??代表的两位数,
288 | 809*??为四位数,8*??的结果为两位数,9*??的
289 | 结果为3位数。求??代表的两位数,及809*??后的结果。
290 | 实现类: com.python100.example.files.Example81
291 |
292 | 82.八进制转换为十进制
293 | 实现类: com.python100.example.files.Example82
294 |
295 | 83.求0—7所能组成的奇数个数
296 | 实现类: com.python100.example.files.Example83
297 |
298 | 84.连接字符串。
299 | 实现类: com.python100.example.files.Example84
300 |
301 | 85.输入一个奇数,然后判断最少几个 9 除于该数的结果为整数
302 | 实现类: com.python100.example.files.Example85
303 |
304 | 86.两个字符串连接程序
305 | 实现类: com.python100.example.files.Example86
306 |
307 | 87.回答结果(结构体变量传递)
308 | 实现类: com.python100.example.files.Example87
309 |
310 | 88.读取7个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*
311 | 实现类: com.python100.example.files.Example88
312 |
313 | 89.某个公司采用公用电话传递数据,数据
314 | 是四位的整数,在传递过程中是加密的,加
315 | 密规则如下:每位数字都加上5,然后用和除
316 | 以10的余数代替该数字,再将第一位和第四
317 | 位交换,第二位和第三位交换。
318 | 实现类: com.python100.example.files.Example89
319 |
320 | 90.列表使用实例
321 | 实现类: com.python100.example.files.Example90
322 |
323 | 91.时间函数举例1
324 | 实现类: com.python100.example.files.Example91
325 |
326 | 92.时间函数举例2
327 | 实现类: com.python100.example.files.Example92
328 |
329 | 93.时间函数举例3
330 | 实现类: com.python100.example.files.Example93
331 |
332 | 94.时间函数举例4,一个猜数游戏,判断一个人反应快慢
333 | 实现类: com.python100.example.files.Example94
334 |
335 | 95.字符串日期转换为易读的日期格式
336 | 实现类: com.python100.example.files.Example95
337 |
338 | 96.计算字符串中子串出现的次数
339 | 实现类: com.python100.example.files.Example96
340 |
341 | 97.从键盘输入一些字符,逐个把它们写到磁盘文件上,直到输入一个 # 为止
342 | 实现类: com.python100.example.files.Example97
343 |
344 | 98.从键盘输入一个字符串,将小写字母全部转换成大写字母,然后输出到一个磁盘文件"test"中保存
345 | 实现类: com.python100.example.files.Example98
346 |
347 | 99.有两个磁盘文件A和B,各存放一行字母,要求把这两个文件中的信息合并(按字母顺序排列), 输出到一个新文件C中
348 | 实现类: com.python100.example.files.Example99
349 |
350 | 100.列表转换为字典
351 | 实现类: com.python100.example.files.Example100
352 |
353 |
354 |
355 |
356 |
357 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Python100example
2 | 内含100例python实例,全为自己编写,在python3.5环境下调试通过
3 |
4 |
5 | 示例:
6 | 主入口:com.python100.example.main.Main.py
7 |
8 | 如若调试哪一个示例,只需在Main.py打开对应示例的注释即可。
9 |
10 | 1.题目:有四个数字:1、2、3、4,能组成多少个互不相同且无重复数字的三位数?各是多少
11 | 实现类:com.python100.example.files.Example1
12 |
13 | 2.企业发放的奖金根据利润提成。
14 | 利润(I)低于或等于10万元时,奖金可提10%;
15 | 利润高于10万元,低于20万元时,低于10万元的部分按10%提成,高于10万元的部分,可提成7.5%;
16 | 20万到40万之间时,高于20万元的部分,可提成5%;
17 | 40万到60万之间时高于40万元的部分,可提成3%;
18 | 60万到100万之间时,高于60万元的部分,可提成1.5%,
19 | 高于100万元时,超过100万元的部分按1%提成,
20 | 从键盘输入当月利润I,求应发放奖金总数?
21 | 实现类: com.python100.example.files.Example2
22 |
23 | 3.一个整数,它加上100后是一个完全平方数,再加上168又是一个完全平方数,请问该数是多少?
24 | 实现类: com.python100.example.files.Example3
25 |
26 | 4.输入某年某月某日,判断这一天是这一年的第几天?
27 | 实现类: com.python100.example.files.Example4
28 |
29 | 5.输入三个整数x,y,z,请把这三个数由小到大输出
30 | 实现类: com.python100.example.files.Example5
31 |
32 | 6.斐波那契数列:0、1、1、2、3、5、8、13、21、34...输出
33 | 实现类: com.python100.example.files.Example6
34 |
35 | 7.将一个列表的数据复制到另一个列表中
36 | 实现类: com.python100.example.files.Example7
37 |
38 | 8.输出 9*9 乘法口诀表
39 | 实现类: com.python100.example.files.Example8
40 |
41 | 9.暂停一秒输出。
42 | 实现类: com.python100.example.files.Example9
43 |
44 | 10.暂停一秒输出,并格式化当前时间
45 | 实现类: com.python100.example.files.Example10
46 |
47 | 11.古典问题:有一对兔子,从出生后第3个月起每个月都生一对兔子,
48 | 小兔子长到第三个月后每个月又生一对兔子,
49 | 假如兔子都不死,问每个月的兔子总数为多少?
50 | 实现类: com.python100.example.files.Example11
51 |
52 | 12.判断101-200之间有多少个素数,并输出所有素数
53 | 实现类: com.python100.example.files.Example12
54 |
55 | 13.打印出所有的"水仙花数",所谓"水仙花数"是指一个三位数,
56 | 其各位数字立方和等于该数本身。
57 | 例如:153是一个"水仙花数",
58 | 因为153=1的三次方+5的三次方+3的三次方
59 | 实现类: com.python100.example.files.Example13
60 |
61 | 14.将一个正整数分解质因数。例如:输入90,打印出90=2*3*3*5
62 | 实现类: com.python100.example.files.Example14
63 |
64 | 15.利用条件运算符的嵌套来完成此题:学习成绩>=90分的同学用A表示,60-89分之间的用B表示,60分以下的用C表示
65 | 实现类: com.python100.example.files.Example15
66 |
67 | 16.输出指定格式的日期
68 | 实现类: com.python100.example.files.Example16
69 |
70 | 17.输入一行字符,分别统计出其中英文字母、空格、数字和其它字符的个数
71 | 实现类: com.python100.example.files.Example17
72 |
73 | 18.求s=a+aa+aaa+aaaa+aa...a的值,其中a是一个数字。
74 | 例如2+22+222+2222+22222(此时共有5个数相加),
75 | 几个数相加由键盘控制。
76 | 实现类: com.python100.example.files.Example18
77 |
78 | 19.一个数如果恰好等于它的因子之和,这个数就称为"完数"。例如6=1+2+3.编程找出1000以内的所有完数。
79 | 实现类: com.python100.example.files.Example19
80 |
81 | 20.一球从100米高度自由落下,每次落地后反跳回原高度的一半;再落下,求它在第10次落地时,共经过多少米?第10次反弹多高?
82 | 实现类: com.python100.example.files.Example20
83 |
84 | 21.猴子吃桃问题:猴子第一天摘下若干个桃子,
85 | 当即吃了一半,还不瘾,又多吃了一个第二天早
86 | 上又将剩下的桃子吃掉一半,又多吃了一个。
87 | 以后每天早上都吃了前一天剩下的一半零一个。
88 | 到第10天早上想再吃时,见只剩下一个桃子了。
89 | 求第一天共摘了多少
90 | 实现类: com.python100.example.files.Example21
91 |
92 | 22.两个乒乓球队进行比赛,各出三人。
93 | 甲队为a,b,c三人,乙队为x,y,z三人。
94 | 已抽签决定比赛名单。有人向队员打听
95 | 比赛的名单。a说他不和x比,c说他不
96 | 和x,z比,请编程序找出三队赛手的名单
97 | 实现类: com.python100.example.files.Example22
98 |
99 | 23.打印出如下图案(菱形):
100 | *
101 | ***
102 | *****
103 | *******
104 | *****
105 | ***
106 | *
107 | 实现类: com.python100.example.files.Example23
108 |
109 | 24.有一分数序列:2/1,3/2,5/3,8/5,13/8,21/13...求出这个数列的前20项之和。
110 | 实现类: com.python100.example.files.Example24
111 |
112 | 25.求1+2!+3!+...+20!的和
113 | 实现类: com.python100.example.files.Example25
114 |
115 | 26.利用递归方法求5!
116 | 实现类: com.python100.example.files.Example26
117 |
118 | 27.利用递归函数调用方式,将所输入的5个字符,以相反顺序打印出来。
119 | 实现类: com.python100.example.files.Example27
120 |
121 | 28.5个人坐在一起,问第五个人多少岁?
122 | 他说比第4个人大2岁。问第4个人岁数,
123 | 他说比第3个人大2岁。问第三个人,
124 | 又说比第2人大两岁。问第2个人,
125 | 说比第一个人大两岁。最后问第一个人,
126 | 他说是10岁。请问第五个人多大?
127 | 实现类: com.python100.example.files.Example28
128 |
129 | 29.给一个不多于5位的正整数,要求:一、求它是几位数,二、逆序打印出各位数字
130 | 实现类: com.python100.example.files.Example29
131 |
132 | 30.一个5位数,判断它是不是回文数。即12321是回文数,个位与万位相同,十位与千位相同。
133 | 实现类: com.python100.example.files.Example30
134 |
135 | 31.输入星期几的第一个字母来判断一下是星期几,如果第一个字母一样,则继续判断第二个字母
136 | 实现类: com.python100.example.files.Example31
137 |
138 | 32.按相反的顺序输出列表的值
139 | 实现类: com.python100.example.files.Example32
140 |
141 | 33.按逗号分隔列表
142 | 实现类: com.python100.example.files.Example33
143 |
144 | 34.练习函数调用。
145 | 实现类: com.python100.example.files.Example34
146 |
147 | 35.文本颜色设置
148 | 实现类: com.python100.example.files.Example35
149 |
150 | 36.求100之内的素数。
151 | 实现类: com.python100.example.files.Example36
152 |
153 | 37.对10个数进行排序
154 | 实现类: com.python100.example.files.Example37
155 |
156 | 38.求一个3*3矩阵主对角线元素之和
157 | 实现类: com.python100.example.files.Example38
158 |
159 | 39.有一个已经排好序的数组。现输入一个数,要求按原来的规律将它插入数组中
160 | 实现类: com.python100.example.files.Example39
161 |
162 | 40.将一个数组逆序输出
163 | 实现类: com.python100.example.files.Example40
164 |
165 | 41.模仿静态变量的用法
166 | 实现类: com.python100.example.files.Example41
167 |
168 | 42.学习使用auto定义变量的用法
169 | 实现类: com.python100.example.files.Example42
170 |
171 | 43.模仿静态变量(static)另一案例。
172 | 实现类: com.python100.example.files.Example43
173 |
174 | 44.两个 3 行 3 列的矩阵,实现其对应位置的数据相加,并返回一个新矩阵
175 | 实现类: com.python100.example.files.Example44
176 |
177 | 45.统计 1 到 100 之和
178 | 实现类: com.python100.example.files.Example45
179 |
180 | 46.求输入数字的平方,如果平方运算后小于 50 则退出
181 | 实现类: com.python100.example.files.Example46
182 |
183 | 47.两个变量值互换。
184 | 实现类: com.python100.example.files.Example47
185 |
186 | 48.数字比较
187 | 实现类: com.python100.example.files.Example48
188 |
189 | 49.使用lambda来创建匿名函数
190 | 实现类: com.python100.example.files.Example49
191 |
192 | 50.输出一个随机数。
193 | 实现类: com.python100.example.files.Example50
194 |
195 | 51.学习使用按位与 &
196 | 实现类: com.python100.example.files.Example51
197 |
198 | 52.学习使用按位或 |
199 | 实现类: com.python100.example.files.Example52
200 |
201 | 53.学习使用按位异或 ^
202 | 实现类: com.python100.example.files.Example53
203 |
204 | 54.取一个整数a从右端开始的4〜7位
205 | 实现类: com.python100.example.files.Example54
206 |
207 | 55.学习使用按位取反~
208 | 实现类: com.python100.example.files.Example55
209 |
210 | 56.画图,学用circle画圆形
211 | 实现类: com.python100.example.files.Example56
212 |
213 | 57.画图,学用line画直线
214 | 实现类: com.python100.example.files.Example57
215 |
216 | 58.画图,学用rectangle画方形
217 | 实现类: com.python100.example.files.Example58
218 |
219 | 59.画图,综合例子
220 | 实现类: com.python100.example.files.Example59
221 |
222 | 60.计算字符串长度
223 | 实现类: com.python100.example.files.Example60
224 |
225 | 61.打印出杨辉三角形(要求打印出10行如下图)
226 | 实现类: com.python100.example.files.Example61
227 |
228 | 62.查找字符串
229 | 实现类: com.python100.example.files.Example62
230 |
231 | 63.省略
232 |
233 | 64.省略
234 |
235 | 65.省略
236 |
237 | 66.输入3个数a,b,c,按大小顺序输出。
238 | 实现类: com.python100.example.files.Example66
239 |
240 | 67.输入数组,最大的与第一个元素交换,最小的与最后一个元素交换,输出数组
241 | 实现类: com.python100.example.files.Example67
242 |
243 | 68.有n个整数,使其前面各数顺序向后移m个位置,最后m个数变成最前面的m个数
244 | 实现类: com.python100.example.files.Example68
245 |
246 | 69.有n个人围成一圈,顺序排号。从第一个人开始报数(从1到3报数),凡报到3的人退出圈子,问最后留下的是原来第几号的那位。
247 | 实现类: com.python100.example.files.Example69
248 |
249 | 70.写一个函数,求一个字符串的长度,在main函数中输入字符串,并输出其长度。
250 | 实现类: com.python100.example.files.Example70
251 |
252 | 71.编写input()和output()函数输入,输出5个学生的数据记录
253 | 实现类: com.python100.example.files.Example72
254 |
255 | 72.创建一个链表
256 | 实现类: com.python100.example.files.Example73
257 |
258 | 73.反向输出一个链表
259 | 实现类: com.python100.example.files.Example74
260 |
261 | 74.列表排序及连接
262 | 实现类: com.python100.example.files.Example75
263 |
264 | 75.放松一下,算一道简单的题目
265 | 实现类: com.python100.example.files.Example76
266 |
267 | 76.编写一个函数,输入n为偶数时,调用函数求1/2+1/4+...+1/n,当输入n为奇数时,调用函数1/1+1/3+...+1/n
268 | 实现类: com.python100.example.files.Example77
269 |
270 | 77.循环输出列表
271 | 实现类: com.python100.example.files.Example77
272 |
273 | 78.找到年龄最大的人,并输出。请找出程序中有什么问题。
274 | 实现类: com.python100.example.files.Example78
275 |
276 | 79.字符串排序
277 | 实现类: com.python100.example.files.Example79
278 |
279 | 80.海滩上有一堆桃子,五只猴子来分。
280 | 第一只猴子把这堆桃子平均分为五份,
281 | 多了一个,这只猴子把多的一个扔入海中,
282 | 拿走了一份。第二只猴子把剩下的桃子又平均
283 | 分成五份,又多了一个,它同样把多的一个扔入
284 | 海中,拿走了一份,第三、第四、第五只猴子都
285 | 是这样做的,问海滩上原来最少有多少个桃子?
286 | 实现类: com.python100.example.files.Example80
287 |
288 | 81.809*??=800*??+9*?? 其中??代表的两位数,
289 | 809*??为四位数,8*??的结果为两位数,9*??的
290 | 结果为3位数。求??代表的两位数,及809*??后的结果。
291 | 实现类: com.python100.example.files.Example81
292 |
293 | 82.八进制转换为十进制
294 | 实现类: com.python100.example.files.Example82
295 |
296 | 83.求0—7所能组成的奇数个数
297 | 实现类: com.python100.example.files.Example83
298 |
299 | 84.连接字符串。
300 | 实现类: com.python100.example.files.Example84
301 |
302 | 85.输入一个奇数,然后判断最少几个 9 除于该数的结果为整数
303 | 实现类: com.python100.example.files.Example85
304 |
305 | 86.两个字符串连接程序
306 | 实现类: com.python100.example.files.Example86
307 |
308 | 87.回答结果(结构体变量传递)
309 | 实现类: com.python100.example.files.Example87
310 |
311 | 88.读取7个数(1—50)的整数值,每读取一个值,程序打印出该值个数的*
312 | 实现类: com.python100.example.files.Example88
313 |
314 | 89.某个公司采用公用电话传递数据,数据
315 | 是四位的整数,在传递过程中是加密的,加
316 | 密规则如下:每位数字都加上5,然后用和除
317 | 以10的余数代替该数字,再将第一位和第四
318 | 位交换,第二位和第三位交换。
319 | 实现类: com.python100.example.files.Example89
320 |
321 | 90.列表使用实例
322 | 实现类: com.python100.example.files.Example90
323 |
324 | 91.时间函数举例1
325 | 实现类: com.python100.example.files.Example91
326 |
327 | 92.时间函数举例2
328 | 实现类: com.python100.example.files.Example92
329 |
330 | 93.时间函数举例3
331 | 实现类: com.python100.example.files.Example93
332 |
333 | 94.时间函数举例4,一个猜数游戏,判断一个人反应快慢
334 | 实现类: com.python100.example.files.Example94
335 |
336 | 95.字符串日期转换为易读的日期格式
337 | 实现类: com.python100.example.files.Example95
338 |
339 | 96.计算字符串中子串出现的次数
340 | 实现类: com.python100.example.files.Example96
341 |
342 | 97.从键盘输入一些字符,逐个把它们写到磁盘文件上,直到输入一个 # 为止
343 | 实现类: com.python100.example.files.Example97
344 |
345 | 98.从键盘输入一个字符串,将小写字母全部转换成大写字母,然后输出到一个磁盘文件"test"中保存
346 | 实现类: com.python100.example.files.Example98
347 |
348 | 99.有两个磁盘文件A和B,各存放一行字母,要求把这两个文件中的信息合并(按字母顺序排列), 输出到一个新文件C中
349 | 实现类: com.python100.example.files.Example99
350 |
351 | 100.列表转换为字典
352 | 实现类: com.python100.example.files.Example100
353 |
354 |
355 |
356 |
357 |
358 |
--------------------------------------------------------------------------------
/com/python100/example/main/Main.py:
--------------------------------------------------------------------------------
1 | # Project: Python100example
2 | # File: Main
3 | # Author: liyaoyan
4 | # Email: helloalvin@163.com
5 | # Time: 2018/10/14 下午12:30
6 | from com.python100.example.files.Example1 import *
7 | from com.python100.example.files.Example2 import *
8 | from com.python100.example.files.Example3 import *
9 | from com.python100.example.files.Example4 import *
10 | from com.python100.example.files.Example5 import *
11 | from com.python100.example.files.Example6 import *
12 | from com.python100.example.files.Example7 import *
13 | from com.python100.example.files.Example8 import *
14 | from com.python100.example.files.Example9 import *
15 | from com.python100.example.files.Example10 import *
16 | from com.python100.example.files.Example11 import *
17 | from com.python100.example.files.Example12 import *
18 | from com.python100.example.files.Example13 import *
19 | from com.python100.example.files.Example14 import *
20 | from com.python100.example.files.Example15 import *
21 | from com.python100.example.files.Example16 import *
22 | from com.python100.example.files.Example17 import *
23 | from com.python100.example.files.Example18 import *
24 | from com.python100.example.files.Example19 import *
25 | from com.python100.example.files.Example20 import *
26 | from com.python100.example.files.Example21 import *
27 | from com.python100.example.files.Example22 import *
28 | from com.python100.example.files.Example23 import *
29 | from com.python100.example.files.Example24 import *
30 | from com.python100.example.files.Example25 import *
31 | from com.python100.example.files.Example26 import *
32 | from com.python100.example.files.Example27 import *
33 | from com.python100.example.files.Example28 import *
34 | from com.python100.example.files.Example29 import *
35 | from com.python100.example.files.Example30 import *
36 | from com.python100.example.files.Example31 import *
37 | from com.python100.example.files.Example32 import *
38 | from com.python100.example.files.Example33 import *
39 | from com.python100.example.files.Example34 import *
40 | from com.python100.example.files.Example35 import *
41 | from com.python100.example.files.Example36 import *
42 | from com.python100.example.files.Example37 import *
43 | from com.python100.example.files.Example38 import *
44 | from com.python100.example.files.Example39 import *
45 | from com.python100.example.files.Example40 import *
46 | from com.python100.example.files.Example41 import *
47 | from com.python100.example.files.Example44 import *
48 | from com.python100.example.files.Example45 import *
49 | from com.python100.example.files.Example46 import *
50 | from com.python100.example.files.Example47 import *
51 | from com.python100.example.files.Example48 import *
52 | from com.python100.example.files.Example49 import *
53 | from com.python100.example.files.Example50 import *
54 | from com.python100.example.files.Example51 import *
55 | from com.python100.example.files.Example52 import *
56 | from com.python100.example.files.Example53 import *
57 | from com.python100.example.files.Example54 import *
58 | from com.python100.example.files.Example55 import *
59 | from com.python100.example.files.Example56 import *
60 | from com.python100.example.files.Example57 import *
61 | from com.python100.example.files.Example58 import *
62 | from com.python100.example.files.Example59 import *
63 | from com.python100.example.files.Example60 import *
64 | from com.python100.example.files.Example61 import *
65 | from com.python100.example.files.Example62 import *
66 | from com.python100.example.files.Example66 import *
67 | from com.python100.example.files.Example67 import *
68 | from com.python100.example.files.Example68 import *
69 | from com.python100.example.files.Example69 import *
70 | from com.python100.example.files.Example70 import *
71 | from com.python100.example.files.Example71 import *
72 | from com.python100.example.files.Example72 import *
73 | from com.python100.example.files.Example73 import *
74 | from com.python100.example.files.Example74 import *
75 | from com.python100.example.files.Example75 import *
76 | from com.python100.example.files.Example76 import *
77 | from com.python100.example.files.Example77 import *
78 | from com.python100.example.files.Example78 import *
79 | from com.python100.example.files.Example79 import *
80 | from com.python100.example.files.Example80 import *
81 | from com.python100.example.files.Example81 import *
82 | from com.python100.example.files.Example82 import *
83 | from com.python100.example.files.Example83 import *
84 | from com.python100.example.files.Example84 import *
85 | from com.python100.example.files.Example85 import *
86 | from com.python100.example.files.Example86 import *
87 | from com.python100.example.files.Example87 import *
88 | from com.python100.example.files.Example88 import *
89 | from com.python100.example.files.Example89 import *
90 | from com.python100.example.files.Example90 import *
91 | from com.python100.example.files.Example91 import *
92 | from com.python100.example.files.Example92 import *
93 | from com.python100.example.files.Example93 import *
94 | from com.python100.example.files.Example94 import *
95 | from com.python100.example.files.Example95 import *
96 | from com.python100.example.files.Example96 import *
97 | from com.python100.example.files.Example97 import *
98 | from com.python100.example.files.Example98 import *
99 | from com.python100.example.files.Example99 import *
100 | from com.python100.example.files.Example100 import *
101 | from com.python100.example.files.TestUtils import *
102 |
103 |
104 | print('Hello,Man,Please open the comment object to Run!')
105 |
106 | #example1 = Example1()
107 | #example1.execute()
108 |
109 | #example2 = Example2()
110 | #example2.execute()
111 |
112 | #example3 = Example3()
113 | #example3.execute()
114 |
115 | #example4 = Example4()
116 | #example4.execute()
117 |
118 | #example5 = Example5()
119 | #example5.execute()
120 |
121 | #example6 = Example6()
122 | #example6.execute()
123 |
124 | #example7 = Example7()
125 | #example7.execute()
126 |
127 | #example8 = Example8()
128 | #example8.execute()
129 |
130 | #example9 = Example9()
131 | #example9.execute()
132 |
133 | #example10 = Example10()
134 | #example10.execute()
135 |
136 | #example11 = Example11()
137 | #example11.execute()
138 |
139 | #example12 = Example12()
140 | #example12.execute()
141 |
142 | #example13 = Example13()
143 | #example13.execute()
144 |
145 | #example14 = Example14()
146 | #example14.execute()
147 |
148 | #example15 = Example15()
149 | #example15.execute()
150 |
151 | #example16 = Example16()
152 | #example16.execute()
153 |
154 | #example17 = Example17()
155 | #example17.execute()
156 |
157 | #example18 = Example18()
158 | #example18.execute()
159 |
160 | #example19 = Example19()
161 | #example19.execute()
162 |
163 | #example20 = Example20()
164 | #example20.execute()
165 |
166 | #example21 = Example21()
167 | #example21.execute()
168 |
169 | #example22 = Example22()
170 | #example22.execute()
171 |
172 | #example23 = Example23()
173 | #example23.execute()
174 |
175 | #example24 = Example24()
176 | #example24.execute()
177 |
178 | #example25 = Example25()
179 | #example25.execute()
180 |
181 | #example26 = Example26()
182 | #example26.execute()
183 |
184 | #example27 = Example27()
185 | #example27.execute()
186 |
187 | #example28 = Example28()
188 | #example28.execute()
189 |
190 | #example29 = Example29()
191 | #example29.execute()
192 |
193 | #example30 = Example30()
194 | #example30.execute()
195 |
196 | #example31 = Example31()
197 | #example31.execute()
198 |
199 | #example32 = Example32()
200 | #example32.execute()
201 |
202 | #example33 = Example33()
203 | #example33.execute()
204 |
205 | #example34 = Example34()
206 | #example34.execute()
207 |
208 | #example35 = Example35()
209 | #example35.execute()
210 |
211 | #example36 = Example36()
212 | #example36.execute()
213 |
214 | #example37 = Example37()
215 | #example37.execute()
216 |
217 | #example38 = Example38()
218 | #example38.execute()
219 |
220 | #example39 = Example39()
221 | #example39.execute()
222 |
223 | #example40 = Example40()
224 | #example40.execute()
225 |
226 | #example41 = Example41()
227 | #example41.execute()
228 |
229 | #example44 = Example44()
230 | #example44.execute()
231 |
232 | #example45 = Example45()
233 | #example45.execute()
234 |
235 | #example46 = Example46()
236 | #example46.execute()
237 |
238 | #example47 = Example47()
239 | #example47.execute()
240 |
241 | #example48 = Example48()
242 | #example48.execute()
243 |
244 | #example49 = Example49()
245 | #example49.execute()
246 |
247 | #example50 = Example50()
248 | #example50.execute()
249 |
250 | #example51 = Example51()
251 | #example51.execute()
252 |
253 | #example52 = Example52()
254 | #example52.execute()
255 |
256 | #example53 = Example53()
257 | #example53.execute()
258 |
259 | #example54 = Example54()
260 | #example54.execute()
261 |
262 | #example55 = Example55()
263 | #example55.execute()
264 |
265 | #example56 = Example56()
266 | #example56.execute()
267 |
268 | #example57 = Example57()
269 | #example57.execute()
270 |
271 | #example58 = Example58()
272 | #example58.execute()
273 |
274 | #example59 = Example59()
275 | #example59.execute()
276 |
277 | #example60 = Example60()
278 | #example60.execute()
279 |
280 | #example61 = Example61()
281 | #example61.execute()
282 |
283 | #example62 = Example62()
284 | #example62.execute()
285 |
286 | #example66 = Example66()
287 | #example66.execute()
288 |
289 | #example67 = Example67()
290 | #example67.execute()
291 |
292 | #example68 = Example68()
293 | #example68.execute()
294 |
295 | #example69 = Example69()
296 | #example69.execute()
297 |
298 | #example70 = Example70()
299 | #example70.execute()
300 |
301 | #example71 = Example71()
302 | #example71.execute()
303 |
304 | #example72 = Example72()
305 | #example72.execute()
306 |
307 | #example73 = Example73()
308 | #example73.execute()
309 |
310 | #example74 = Example74()
311 | #example74.execute()
312 |
313 | #example75 = Example75()
314 | #example75.execute()
315 |
316 | #example76 = Example76()
317 | #example76.execute()
318 |
319 | #example77 = Example77()
320 | #example77.execute()
321 |
322 | #example78 = Example78()
323 | #example78.execute()
324 |
325 | #example79 = Example79()
326 | #example79.execute()
327 |
328 | #example80 = Example80()
329 | #example80.execute()
330 |
331 | #example81 = Example81()
332 | #example81.execute()
333 |
334 | #example82 = Example82()
335 | #example82.execute()
336 |
337 | #example83 = Example83()
338 | #example83.execute()
339 |
340 | #example84 = Example84()
341 | #example84.execute()
342 |
343 | #example85 = Example85()
344 | #example85.execute()
345 |
346 | #example86 = Example86()
347 | #example86.execute()
348 |
349 | #example87 = Example87()
350 | #example87.execute()
351 |
352 | #example88 = Example88()
353 | #example88.execute()
354 |
355 | #example89 = Example89()
356 | #example89.execute()
357 |
358 | #example90 = Example90()
359 | #example90.execute()
360 |
361 | #example91 = Example91()
362 | #example91.execute()
363 |
364 | #example92 = Example92()
365 | #example92.execute()
366 |
367 | #example93 = Example93()
368 | #example93.execute()
369 |
370 | #example94 = Example94()
371 | #example94.execute()
372 |
373 | #example95 = Example95()
374 | #example95.execute()
375 |
376 | #example96 = Example96()
377 | #example96.execute()
378 |
379 | #example97 = Example97()
380 | #example97.execute()
381 |
382 | #example98 = Example98()
383 | #example98.execute()
384 |
385 | #example99 = Example99()
386 | #example99.execute()
387 |
388 | #example100 = Example100()
389 | #example100.execute()
390 |
391 | #testutils = TestUtils()
392 | #testutils.execute()
393 |
394 |
395 |
--------------------------------------------------------------------------------