├── Basic Python Theory
├── Part 3 (Import Files)
│ ├── .idea
│ │ ├── .name
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── 3 (Import Fils).iml
│ ├── __pycache__
│ │ └── tools.cpython-310.pyc
│ ├── main.py
│ └── src
│ │ ├── __pycache__
│ │ └── tools.cpython-310.pyc
│ │ └── tools.py
├── Part 1 (Basic Syntax)
│ ├── .idea
│ │ ├── .name
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Giraffe.iml
│ ├── 02 - numbers.py
│ ├── 13 - exponential function.py
│ ├── 03 - calculator.py
│ ├── 08 - selection.py
│ ├── 06 - tuple.py
│ ├── 16 - try expect.py
│ ├── 01 - strings.py
│ ├── 14 - 2D list.py
│ ├── 07 - funtions.py
│ ├── 04 - lists.py
│ ├── 10 - dictionary.py
│ ├── 15 - translator.py
│ ├── 12 - for.py
│ ├── 09 - calculator 2.0.py
│ ├── 11.0 - while.py
│ ├── 11.1 - while.py
│ └── 05 - listFunctions.py
├── Part 2 (File Handeling)
│ ├── write & append
│ │ ├── contact.txt
│ │ ├── .idea
│ │ │ ├── .gitignore
│ │ │ ├── misc.xml
│ │ │ ├── inspectionProfiles
│ │ │ │ └── profiles_settings.xml
│ │ │ ├── modules.xml
│ │ │ └── write & append.iml
│ │ └── main.py
│ └── read
│ │ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Giraffe - 2.iml
│ │ ├── employees.txt
│ │ └── main.py
├── Part 5 (Inheritance)
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── 6 Inheritance.iml
│ ├── __pycache__
│ │ ├── dog.cpython-310.pyc
│ │ └── pet.cpython-310.pyc
│ ├── pet.py
│ ├── main.py
│ └── dog.py
└── Part 4 (Classess & Objects)
│ ├── .idea
│ ├── .gitignore
│ ├── misc.xml
│ ├── inspectionProfiles
│ │ └── profiles_settings.xml
│ ├── 5 Classess & Objects.iml
│ └── modules.xml
│ ├── __pycache__
│ └── student.cpython-310.pyc
│ ├── main.py
│ └── student.py
├── Question Set 1 - (Selection Statement)
├── Version 1
│ ├── Version 1 - Randula
│ │ ├── .idea
│ │ │ ├── .name
│ │ │ ├── .gitignore
│ │ │ ├── misc.xml
│ │ │ ├── vcs.xml
│ │ │ ├── inspectionProfiles
│ │ │ │ └── profiles_settings.xml
│ │ │ ├── modules.xml
│ │ │ └── Version 1 - Randula.iml
│ │ └── main.py
│ └── Version 1_(advertisement).jpeg
├── Version 5
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 5.iml
│ ├── Version 5_salary.jpeg
│ └── main.py
├── Version 2
│ ├── Version 2 - Randula
│ │ ├── .idea
│ │ │ ├── .gitignore
│ │ │ ├── misc.xml
│ │ │ ├── vcs.xml
│ │ │ ├── inspectionProfiles
│ │ │ │ └── profiles_settings.xml
│ │ │ ├── modules.xml
│ │ │ └── Version 2 - Randula.iml
│ │ └── main.py
│ └── Version 2_ (restaurant).jpeg
├── Version 3
│ ├── Version 3 - Randula
│ │ ├── .idea
│ │ │ ├── .gitignore
│ │ │ ├── misc.xml
│ │ │ ├── vcs.xml
│ │ │ ├── inspectionProfiles
│ │ │ │ └── profiles_settings.xml
│ │ │ ├── modules.xml
│ │ │ └── Version 3 - Randula.iml
│ │ └── main.py
│ └── Version 3 (Bank).jpeg
└── Version 4
│ ├── Version 4 - Randula
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 4 - Randula.iml
│ └── main.py
│ └── Version 4 (partyPackage).jpeg
├── Question Set 4 - (Lists)
├── Version 1
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 1.iml
│ ├── Version 1.png
│ └── main.py
├── Version 2
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 2.iml
│ ├── Version 2.png
│ └── main.py
├── Version 3
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 3.iml
│ ├── Version 3.png
│ └── main.py
└── Version 4
│ ├── .idea
│ ├── .gitignore
│ ├── misc.xml
│ ├── vcs.xml
│ ├── inspectionProfiles
│ │ └── profiles_settings.xml
│ ├── modules.xml
│ └── Version 4.iml
│ ├── Version 4.png
│ └── main.py
├── Question Set 3 - (Functions)
├── Version 1
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 1.iml
│ ├── Version 1.png
│ └── main.py
├── Version 2
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 2.iml
│ ├── Version 2.png
│ └── main.py
├── Version 3
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 3.iml
│ ├── Version 3.png
│ └── main.py
├── Version 4
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 4.iml
│ ├── Version 4.png
│ └── main.py
└── Version 5
│ ├── .idea
│ ├── .gitignore
│ ├── misc.xml
│ ├── vcs.xml
│ ├── inspectionProfiles
│ │ └── profiles_settings.xml
│ ├── modules.xml
│ └── Version 5.iml
│ ├── Version 5.png
│ └── main.py
├── Question Set 5 - (Classess & Objects)
├── 1
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── 1.iml
│ ├── Version 1.png
│ ├── __pycache__
│ │ └── salesman.cpython-310.pyc
│ ├── main.py
│ └── salesman.py
├── 2
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── 2.iml
│ ├── Version 2.png
│ ├── __pycache__
│ │ └── event.cpython-310.pyc
│ ├── main.py
│ └── event.py
├── 3
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── 3.iml
│ ├── Version 3.png
│ ├── __pycache__
│ │ └── student.cpython-310.pyc
│ ├── student.py
│ └── main.py
├── 4
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── 4.iml
│ ├── Version 4.png
│ ├── __pycache__
│ │ └── book.cpython-310.pyc
│ ├── book.py
│ └── main.py
└── 5
│ ├── .idea
│ ├── .gitignore
│ ├── misc.xml
│ ├── inspectionProfiles
│ │ └── profiles_settings.xml
│ ├── modules.xml
│ └── 5.iml
│ ├── Version 5.png
│ ├── __pycache__
│ └── train.cpython-310.pyc
│ ├── main.py
│ └── train.py
├── Question Set 2 - (Repetition Statement)
├── Version 1
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 1.iml
│ ├── Version 1 - (pizzaOutlet).png
│ └── main.py
├── Version 2
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 2.iml
│ ├── Version 2 - (purchasedItem).jpeg
│ └── main.py
├── Version 3
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 3.iml
│ ├── Version 3 - (bowlingGame).jpeg
│ └── main.py
├── Version 4
│ ├── .idea
│ │ ├── .gitignore
│ │ ├── misc.xml
│ │ ├── vcs.xml
│ │ ├── inspectionProfiles
│ │ │ └── profiles_settings.xml
│ │ ├── modules.xml
│ │ └── Version 4.iml
│ ├── Version 4 - (burgerOutlet).jpeg
│ └── main.py
└── Version 5
│ ├── .idea
│ ├── .gitignore
│ ├── misc.xml
│ ├── vcs.xml
│ ├── inspectionProfiles
│ │ └── profiles_settings.xml
│ ├── modules.xml
│ └── Version 5.iml
│ ├── Version 5 - (stationaryShop).jpeg
│ └── main.py
├── .gitignore
├── LICENSE
└── README.md
/Basic Python Theory/Part 3 (Import Files)/.idea/.name:
--------------------------------------------------------------------------------
1 | main.py
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/.idea/.name:
--------------------------------------------------------------------------------
1 | 6 - tuple.py
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1 - Randula/.idea/.name:
--------------------------------------------------------------------------------
1 | main.py
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 1/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 2/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 3/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 4/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/write & append/contact.txt:
--------------------------------------------------------------------------------
1 | Randula - 0713861718
2 | Randula - 0703818147
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 1/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 2/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 3/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 4/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 5/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 4 (Classess & Objects)/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/read/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 5/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 1/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 2/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 3/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 4/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 5/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/write & append/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/02 - numbers.py:
--------------------------------------------------------------------------------
1 | number = 5 + 2
2 |
3 | print(str(number) + " Hello")
4 |
5 | #print(number + " Hello")
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1 - Randula/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 2/Version 2 - Randula/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 3/Version 3 - Randula/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 4/Version 4 - Randula/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/read/employees.txt:
--------------------------------------------------------------------------------
1 | James - Chairman
2 | Jacob - Secretary
3 | Amy - Member
4 | Regina - Assistant
5 | Terry - Member
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 1/Version 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 4 - (Lists)/Version 1/Version 1.png
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 2/Version 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 4 - (Lists)/Version 2/Version 2.png
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 3/Version 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 4 - (Lists)/Version 3/Version 3.png
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 4/Version 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 4 - (Lists)/Version 4/Version 4.png
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 1/Version 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 3 - (Functions)/Version 1/Version 1.png
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 2/Version 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 3 - (Functions)/Version 2/Version 2.png
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 3/Version 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 3 - (Functions)/Version 3/Version 3.png
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 4/Version 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 3 - (Functions)/Version 4/Version 4.png
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 5/Version 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 3 - (Functions)/Version 5/Version 5.png
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/Version 1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/1/Version 1.png
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/Version 2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/2/Version 2.png
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/Version 3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/3/Version 3.png
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/Version 4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/4/Version 4.png
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/Version 5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/5/Version 5.png
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 3/Version 3 (Bank).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 1 - (Selection Statement)/Version 3/Version 3 (Bank).jpeg
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 5/Version 5_salary.jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 1 - (Selection Statement)/Version 5/Version 5_salary.jpeg
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/__pycache__/dog.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Basic Python Theory/Part 5 (Inheritance)/__pycache__/dog.cpython-310.pyc
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/__pycache__/pet.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Basic Python Theory/Part 5 (Inheritance)/__pycache__/pet.cpython-310.pyc
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/__pycache__/event.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/2/__pycache__/event.cpython-310.pyc
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/__pycache__/book.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/4/__pycache__/book.cpython-310.pyc
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/__pycache__/train.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/5/__pycache__/train.cpython-310.pyc
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/__pycache__/tools.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Basic Python Theory/Part 3 (Import Files)/__pycache__/tools.cpython-310.pyc
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/main.py:
--------------------------------------------------------------------------------
1 |
2 | from src import tools
3 |
4 | output = tools.power(2 , 3)
5 | print(output)
6 |
7 | print()
8 |
9 | value = tools.percentage(80 , 100)
10 | print(value)
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/__pycache__/salesman.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/1/__pycache__/salesman.cpython-310.pyc
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/__pycache__/student.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 5 - (Classess & Objects)/3/__pycache__/student.cpython-310.pyc
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 2/Version 2_ (restaurant).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 1 - (Selection Statement)/Version 2/Version 2_ (restaurant).jpeg
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 4/Version 4 (partyPackage).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 1 - (Selection Statement)/Version 4/Version 4 (partyPackage).jpeg
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/src/__pycache__/tools.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Basic Python Theory/Part 3 (Import Files)/src/__pycache__/tools.cpython-310.pyc
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1_(advertisement).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 1 - (Selection Statement)/Version 1/Version 1_(advertisement).jpeg
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 1/Version 1 - (pizzaOutlet).png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 2 - (Repetition Statement)/Version 1/Version 1 - (pizzaOutlet).png
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 3/Version 3 - (bowlingGame).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 2 - (Repetition Statement)/Version 3/Version 3 - (bowlingGame).jpeg
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 4/Version 4 - (burgerOutlet).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 2 - (Repetition Statement)/Version 4/Version 4 - (burgerOutlet).jpeg
--------------------------------------------------------------------------------
/Basic Python Theory/Part 4 (Classess & Objects)/__pycache__/student.cpython-310.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Basic Python Theory/Part 4 (Classess & Objects)/__pycache__/student.cpython-310.pyc
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 2/Version 2 - (purchasedItem).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 2 - (Repetition Statement)/Version 2/Version 2 - (purchasedItem).jpeg
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 5/Version 5 - (stationaryShop).jpeg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Randula98/Python-For-Beginners/HEAD/Question Set 2 - (Repetition Statement)/Version 5/Version 5 - (stationaryShop).jpeg
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/13 - exponential function.py:
--------------------------------------------------------------------------------
1 |
2 | def power(base , pow):
3 | answer = 1
4 | for index in range(pow):
5 | answer = answer * base
6 | return answer
7 |
8 | print(power(2 , 14))
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/03 - calculator.py:
--------------------------------------------------------------------------------
1 | num1 = input("Enter a Number : ")
2 | num2 = input("Enter another Number : ")
3 |
4 | #answer = int(num1) + int(num2)
5 |
6 | answer = float(num1) + float(num2)
7 |
8 | print(answer)
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 1/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 2/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 3/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 4/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/08 - selection.py:
--------------------------------------------------------------------------------
1 | #selection
2 |
3 | val1 = True
4 | val2 = False
5 |
6 | if val1 and val2:
7 | print("All true")
8 | elif val1 or val2:
9 | print("One true")
10 | else:
11 | print("False")
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 1/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 2/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 3/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 4/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 5/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/pet.py:
--------------------------------------------------------------------------------
1 | #super class
2 | class Pet:
3 | def __init__(self , name , age):
4 | self.name = name
5 | self.age = age
6 |
7 | def play(self):
8 | print(self.name + " is playing with you")
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 1/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 2/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 3/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 4/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 5/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 1/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 2/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 3/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 4/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/06 - tuple.py:
--------------------------------------------------------------------------------
1 | #tuples cannot be modified ()
2 |
3 | tuple = (1 , 2 , 3 , 4 , 5)
4 | print(tuple)
5 | print()
6 |
7 | #list of tuples
8 | list = [(1 , 2) , (3 , 4) , (5 , 6)]
9 | print(list)
10 | print()
11 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/read/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 4 (Classess & Objects)/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 5/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 1/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 2/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 3/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 4/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 5/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 5/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/write & append/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 1/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 2/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 3/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 4/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 5/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 1/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 2/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 3/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 4/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1 - Randula/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 2/Version 2 - Randula/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 3/Version 3 - Randula/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 4/Version 4 - Randula/.idea/misc.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 1/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 2/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 3/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 4/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 5/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 4 (Classess & Objects)/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/16 - try expect.py:
--------------------------------------------------------------------------------
1 |
2 |
3 | try:
4 | answer = 10 / 0
5 | input = input("Enter a number : ")
6 | input = int(input)
7 |
8 | except ZeroDivisionError as err:
9 | print(err)
10 |
11 | except ValueError:
12 | print("Error")
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/read/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1 - Randula/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 2/Version 2 - Randula/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 3/Version 3 - Randula/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 4/Version 4 - Randula/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 5/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 1/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 2/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 3/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 4/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 5/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/01 - strings.py:
--------------------------------------------------------------------------------
1 | text1 = "HellO WorlD"
2 |
3 | text2 = "hello world"
4 |
5 | print(text1.upper())
6 | print(text1.lower())
7 |
8 | print(text2.upper().isupper())
9 |
10 | print(text1.index("W"))
11 |
12 | print(text1.replace("HellO" , "Hi"))
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/write & append/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/14 - 2D list.py:
--------------------------------------------------------------------------------
1 |
2 | grid = [
3 | [1 , 2 , 3],
4 | [4 , 5 , 6],
5 | [7 , 8 , 9],
6 | [10 , 11]
7 | ]
8 |
9 | """
10 | for row in grid:
11 | print(row)
12 | """
13 |
14 | for row in grid:
15 | for col in row:
16 | print(col)
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/main.py:
--------------------------------------------------------------------------------
1 | from pet import Pet
2 | from dog import Dog
3 |
4 | #super class behavior
5 | pet1 = Pet("Tim" , 5)
6 | pet1.play()
7 | print()
8 |
9 | #subclass behavior
10 | dog1 = Dog("Bob" , 2 , "German Shepheard")
11 | dog1.play()
12 | dog1.bark()
13 |
14 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1 - Randula/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 2/Version 2 - Randula/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 3/Version 3 - Randula/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 4/Version 4 - Randula/.idea/inspectionProfiles/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/src/tools.py:
--------------------------------------------------------------------------------
1 | import random
2 |
3 | def power(base , pow):
4 | answer = 1
5 | for index in range(pow):
6 | answer = answer * base
7 |
8 | return answer
9 |
10 | def percentage(value , total):
11 | percentage = (value / total) * 100
12 | return percentage
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/write & append/main.py:
--------------------------------------------------------------------------------
1 | #create or overwrite
2 | #file = open("contact.txt" , "w")
3 |
4 | #append
5 | file = open("contact.txt" , "a")
6 |
7 | name = input("Enter Name : ")
8 | contact = input("Enter Contact No : ")
9 |
10 | file.write("\n" + name + " - " + contact)
11 |
12 | file.close()
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 1/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 2/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 3/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 4/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 1/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 2/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 3/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 4/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 5/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/.idea/1.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/.idea/2.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/.idea/3.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/.idea/4.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/.idea/5.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/read/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 5/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 1/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 2/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 3/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 4/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 5/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 1/.idea/Version 1.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 2/.idea/Version 2.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 3/.idea/Version 3.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 4/.idea/Version 4.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/.idea/Giraffe.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 1/.idea/Version 1.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 2/.idea/Version 2.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 3/.idea/Version 3.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 4/.idea/Version 4.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 5/.idea/Version 5.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/.idea/6 Inheritance.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/read/.idea/Giraffe - 2.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 3 (Import Files)/.idea/3 (Import Fils).iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 5/.idea/Version 5.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 1/.idea/Version 1.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 2/.idea/Version 2.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 3/.idea/Version 3.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 4/.idea/Version 4.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 5/.idea/Version 5.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/07 - funtions.py:
--------------------------------------------------------------------------------
1 | #basic
2 |
3 | def sayHello():
4 | print("Hello world")
5 |
6 | def sayHi(name):
7 | print("Hi " + name)
8 |
9 | sayHello()
10 | sayHi("Steve")
11 | print()
12 |
13 | #return statement
14 | def cube(num):
15 | return (num * num * num)
16 |
17 | answer = cube(3)
18 | print(answer)
19 | print()
20 |
21 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/write & append/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 4 (Classess & Objects)/.idea/5 Classess & Objects.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 4 (Classess & Objects)/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/write & append/.idea/write & append.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1 - Randula/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 2/Version 2 - Randula/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 3/Version 3 - Randula/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 4/Version 4 - Randula/.idea/modules.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1 - Randula/.idea/Version 1 - Randula.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 2/Version 2 - Randula/.idea/Version 2 - Randula.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 3/Version 3 - Randula/.idea/Version 3 - Randula.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 4/Version 4 - Randula/.idea/Version 4 - Randula.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/04 - lists.py:
--------------------------------------------------------------------------------
1 | #lists can be modifed []
2 |
3 | list = ['One' , 'Two' , 'Three' , 'Four' , 'Five' , 'Six' , 'Seven' , 'Eight' , 'Nine' , 'Ten']
4 |
5 | print(list)
6 | print(list[0])
7 | print(list[-1])
8 | print()
9 |
10 | #access
11 | print(list[1:])
12 | print(list[-2:])
13 | print(list[2:5])
14 | print()
15 |
16 | #change
17 | list[1] = "2"
18 | print(list)
19 |
20 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 4 (Classess & Objects)/main.py:
--------------------------------------------------------------------------------
1 | #import file
2 | from student import Student
3 |
4 | #create object
5 | student1 = Student("John" , "Software Engineer" , 3.8 , 3 , 1)
6 | student2 = Student("Shyla" , "Graphic Designer" , 3.2 , 2 , 2)
7 |
8 | print(student1.name)
9 | print(student1.on_deans_list())
10 |
11 | print()
12 |
13 | print(student2.name)
14 | print(student2.on_deans_list())
15 |
16 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/10 - dictionary.py:
--------------------------------------------------------------------------------
1 |
2 | dict = {
3 | "brand": "Ford",
4 | "model": "Mustang",
5 | "year": 1964
6 | }
7 | print(dict["brand"])
8 | print()
9 |
10 | con = {
11 | 1 : "One",
12 | 2 : "Two",
13 | "Three" : 3,
14 | "no" : 0,
15 | "jan" : "January",
16 | "feb" : "February"
17 | }
18 |
19 | print(con.get("jan"))
20 | print(con.get("ja"))
21 | print(con.get("ja" , "not found"))
22 | print(con.get(1))
23 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/15 - translator.py:
--------------------------------------------------------------------------------
1 |
2 | def translate(text):
3 | output = ""
4 | for letter in text:
5 | if letter in "AEIOUaeiou":
6 | if letter.isupper():
7 | output = output + "*"
8 | else:
9 | output = output + "#"
10 | else:
11 | output = output + letter
12 | return output
13 |
14 |
15 | input = input("Enter a Text : ")
16 | print(translate(input))
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/12 - for.py:
--------------------------------------------------------------------------------
1 | list = ["One" , "Two" , "Three"]
2 | text = "Hello World"
3 |
4 | for item in list:
5 | print(item)
6 |
7 | print()
8 |
9 | for letter in text:
10 | print(letter)
11 |
12 | print()
13 |
14 | for (index) in range(10):
15 | print(index)
16 |
17 | print()
18 |
19 | for (index) in range (3 , 10):
20 | print(index)
21 |
22 | print()
23 |
24 | for index in range(1 , len(list)):
25 | print(list[index])
26 |
27 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/main.py:
--------------------------------------------------------------------------------
1 | #import file
2 | from event import Event
3 |
4 | #create objects
5 | e1 = Event(1 , "party" , "red" , "Nugegoda")
6 | e2 = Event(2 , "wedding" , "purple" , "Maharagama")
7 | e3 = Event(3 , "party" , "pink" , "Malabe")
8 |
9 | #set new locations
10 | e1.setEventLocation()
11 | e2.setEventLocation()
12 | e3.setEventLocation()
13 |
14 | #display details
15 | e1.displayEventDetails()
16 | e2.displayEventDetails()
17 | e3.displayEventDetails()
--------------------------------------------------------------------------------
/Basic Python Theory/Part 5 (Inheritance)/dog.py:
--------------------------------------------------------------------------------
1 | #sub class
2 | from pet import Pet
3 |
4 | #inheritance
5 | class Dog(Pet):
6 |
7 | #inherit variables from the super class
8 | def __init__(self , name , age , breed):
9 | Pet.__init__(self , name , age)
10 | self.breed = breed
11 |
12 | def bark(self):
13 | print(self.name + " is Barking")
14 |
15 | #function overriding
16 | def play(self):
17 | print(self.name + " the dog is playing with you")
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/main.py:
--------------------------------------------------------------------------------
1 | #import files
2 | from train import Train
3 |
4 | #create objects set vales for objects
5 | t1 = Train(1 , 200 , "6:00AM" , "Kandy")
6 | t2 = Train(2 , 150 , "7:30AM" , "Galle")
7 | t3 = Train(3 , 300 , "4:00AM" , "Jaffna")
8 |
9 | #set new start time to objects
10 | t1.setStartTime()
11 | t2.setStartTime()
12 | t3.setStartTime()
13 |
14 | #display the details of the objects
15 | t1.displayTrainDetails()
16 | t2.displayTrainDetails()
17 | t3.displayTrainDetails()
18 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/main.py:
--------------------------------------------------------------------------------
1 | #import file
2 | from salesman import Salesman
3 |
4 | #create objects
5 | s1 = Salesman(1 , "John" , 30000 , "772358375")
6 | s2 = Salesman(2 , "Ann" , 40000 , "773029452")
7 | s3 = Salesman(3 , "Leema" , 35000 , "778294526")
8 |
9 | #set new contact numbers
10 | s1.setSalesmanContactNo()
11 | s2.setSalesmanContactNo()
12 | s3.setSalesmanContactNo()
13 |
14 | #display details
15 | s1.displaySalesmanDetails()
16 | s2.displaySalesmanDetails()
17 | s3.displaySalesmanDetails()
--------------------------------------------------------------------------------
/Basic Python Theory/Part 4 (Classess & Objects)/student.py:
--------------------------------------------------------------------------------
1 | #create class
2 | class Student:
3 | #define class variables
4 | def __init__(self , name , major , gpa , year , semester): #use 2 underscore (_) marks
5 | self.name = name
6 | self.major = major
7 | self.gpa = gpa
8 | self.year = year
9 | self.semester = semester
10 |
11 | #define class functions
12 | def on_deans_list(self):
13 | if self.gpa >= 3.5:
14 | return True
15 | else:
16 | return False
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/09 - calculator 2.0.py:
--------------------------------------------------------------------------------
1 |
2 | num1 = input("Enter a number : ")
3 | num2 = input("Enter another number : ")
4 | op = input("Enter an operator (+ | - | * | /) : ")
5 |
6 | num1 = float(num1)
7 | num2 = float(num2)
8 |
9 | if op == '+':
10 | answer = num1 + num2
11 | elif op == '-':
12 | answer = num1 - num2
13 | elif op == '*':
14 | answer = num1 * num2
15 | elif op == '/':
16 | answer = num1 / num2
17 | else:
18 | print("Invalid Operator")
19 | #immidiate termination
20 | quit()
21 |
22 | print("Answer is " + str(answer))
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/book.py:
--------------------------------------------------------------------------------
1 | #define class
2 | class Book:
3 | #define class variables
4 | def __init__ (self , bookID , bookName , author):
5 | self.bookID = bookID
6 | self.bookName = bookName
7 | self.author = author
8 |
9 | #define class functions
10 | def displayBookDetails(self):
11 | print()
12 | print("Book ID = " + str(self.bookID))
13 | print("Book Name = " + self.bookName)
14 | print("Book Author = " + self.author)
15 |
16 | def setBookID(self , pid):
17 | self.bookID = pid
18 |
19 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 5/main.py:
--------------------------------------------------------------------------------
1 |
2 | #define findRadianValue function
3 | def findRadianValue(angleInDegree):
4 | angleInRadian = float(angleInDegree / 180 * 22 / 7)
5 | return angleInRadian
6 |
7 | #define printRadianValues function
8 | def printRadianValues():
9 | print("Angle(degrees)\tAngle(Radians)")
10 | for degree in range(100 , 210 , 20):
11 | radian = findRadianValue(degree)
12 | radian = float(radian)
13 | radian = round(radian , 2)
14 | print(str(degree) + "\t\t\t\t" + str(radian))
15 |
16 |
17 | #call the printRadianValues function
18 | printRadianValues()
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/4/main.py:
--------------------------------------------------------------------------------
1 | #import files
2 | from book import Book
3 |
4 | #create objects and set values
5 | b1 = Book("1212" , "Jane Eyre" , "Charlotte Bronte")
6 | b2 = Book("1234" , "Divergent" , "Veronica Roth")
7 | b3 = Book("3456" , "Matilda" , "Ronald Dahl")
8 |
9 | #set new id for objects
10 | id = input("Input new book ID 1 : ")
11 | b1.setBookID(id)
12 |
13 | id = input("Input new book ID 2 : ")
14 | b2.setBookID(id)
15 |
16 | id = input("Input new book ID 3 : ")
17 | b3.setBookID(id)
18 |
19 | #display object variables
20 | b1.displayBookDetails()
21 | b2.displayBookDetails()
22 | b3.displayBookDetails()
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/11.0 - while.py:
--------------------------------------------------------------------------------
1 |
2 | #i = 1
3 | #while i <= 10:
4 | # print(i)
5 | # i += 1
6 | #print("End")
7 | #print()
8 |
9 | answer = 0
10 | tries = 3
11 | out_of_tries = False
12 | print("What is 2 + 3 * 4 + (2 * 8 / 4) : ")
13 |
14 | while answer != 18 and not(out_of_tries):
15 | if (tries > 0):
16 | answer = input("Enter answer " + str(tries) + " Tries left : ")
17 | answer = int(answer)
18 | tries -= 1
19 | else:
20 | out_of_tries = True
21 |
22 |
23 | if (out_of_tries == False):
24 | print("Correct")
25 | else:
26 | print("Wrong")
27 |
28 | print()
29 | print()
30 |
31 |
32 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Prerequisites
2 | *.d
3 |
4 | # Object files
5 | *.o
6 | *.ko
7 | *.obj
8 | *.elf
9 |
10 | # Linker output
11 | *.ilk
12 | *.map
13 | *.exp
14 |
15 | # Precompiled Headers
16 | *.gch
17 | *.pch
18 |
19 | # Libraries
20 | *.lib
21 | *.a
22 | *.la
23 | *.lo
24 |
25 | # Shared objects (inc. Windows DLLs)
26 | *.dll
27 | *.so
28 | *.so.*
29 | *.dylib
30 |
31 | # Executables
32 | *.exe
33 | *.out
34 | *.app
35 | *.i*86
36 | *.x86_64
37 | *.hex
38 |
39 | # Debug files
40 | *.dSYM/
41 | *.su
42 | *.idb
43 | *.pdb
44 |
45 | # Kernel Module Compile Results
46 | *.mod*
47 | *.cmd
48 | .tmp_versions/
49 | modules.order
50 | Module.symvers
51 | Mkfile.old
52 | dkms.conf
53 |
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 4/main.py:
--------------------------------------------------------------------------------
1 |
2 | #define the array
3 | num = [0 for i in range(8)]
4 |
5 | #define an integer to count the pattern
6 | pattern = 0
7 |
8 | #get user inputs
9 | for i in range(8):
10 | num[i] = input("Enter a number : ")
11 |
12 | print()
13 | #display the user input
14 | print("num array : " , end = " ")
15 | for i in range(8):
16 | print(num[i] , end = " ")
17 | print()
18 |
19 | #check the array for the pattern
20 | for i in range(1 , 8):
21 | if num[i] == "3" and num[i - 1] == "1":
22 | pattern = pattern + 1
23 |
24 | #display the number of patters appear
25 | print("Number of time the pattern '1 3 ' appear : " + str(pattern))
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/2/event.py:
--------------------------------------------------------------------------------
1 | #create class
2 | class Event:
3 | #create class variables
4 | def __init__(self , eventId , eventType , themeColor , location):
5 | self.eventId = eventId
6 | self.eventType = eventType
7 | self.themeColor = themeColor
8 | self.location = location
9 |
10 | #define class functions
11 | def displayEventDetails(self):
12 | print()
13 | print("Event Type = " + self.eventType)
14 | print("Theme Color = " + self.themeColor)
15 | print("Location = " + self.location)
16 |
17 | def setEventLocation(self):
18 | self.location = input("Input new location of event " + str(self.eventId) + " : ")
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 4/main.py:
--------------------------------------------------------------------------------
1 |
2 | #get user input for burger type
3 | bType = input("Enter Burger Type : ")
4 |
5 | while bType == "1" or bType == "2" or bType == "3":
6 | total = 0
7 | #get user input for quantity
8 | quantity = input("Enter Quantity : ")
9 | quantity = float(quantity)
10 |
11 | if bType == "1":
12 | total = (500 * quantity)
13 | elif bType == "2":
14 | total = (500 + 50) * quantity
15 | else:
16 | total = (500 + 100) * quantity
17 |
18 | #diplay total price
19 | print("Total Price : " + str(total))
20 |
21 | print()
22 | #get user input for burger type
23 | bType = input("Enter Burger Type : ")
24 |
25 |
26 |
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 3/Version 3 - Randula/main.py:
--------------------------------------------------------------------------------
1 |
2 | #get user input for age
3 | age = input("Age : ")
4 | age = int(age)
5 |
6 | #get user input for bank balance
7 | bankBalance = input("Bank Balance : ")
8 | bankBalance = float(bankBalance)
9 | while bankBalance < 0:
10 | print("Invalid Input!! Try again")
11 | bankBalance = input("Bank Balance : ")
12 |
13 | #find the gift according to the age and the bank balance
14 | if age <= 18:
15 | if bankBalance > 100000:
16 | gift = "Tablet"
17 | else:
18 | gift = "School bag"
19 | else:
20 | if bankBalance > 100000:
21 | gift = "Rice Cooker"
22 | else:
23 | gift = "Travelling Bag"
24 |
25 | #display the gift
26 | print("Gift : " + gift)
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/5/train.py:
--------------------------------------------------------------------------------
1 | #define class
2 | class Train:
3 | #define class variables
4 | def __init__(self , trainID , capacity , startTime , destination):
5 | self.trainID = trainID
6 | self.capacity = capacity
7 | self.startTime = startTime
8 | self.destination = destination
9 |
10 | #define class functions
11 | def displayTrainDetails(self):
12 | print()
13 | print("Train ID = " + str(self.trainID))
14 | print("Capacity = " + str(self.capacity))
15 | print("Start Time = " + self.startTime)
16 | print("Destination = " + self.destination)
17 |
18 | def setStartTime(self):
19 | self.startTime = input("Input new start time of train " + str(self.trainID) + " : ")
--------------------------------------------------------------------------------
/Basic Python Theory/Part 2 (File Handeling)/read/main.py:
--------------------------------------------------------------------------------
1 |
2 | file = open ("employees.txt" , "r")
3 |
4 | if(file.readable()):
5 | print("Success")
6 | else:
7 | print("Error")
8 | print()
9 |
10 | #read the whole file
11 | print(file.read())
12 |
13 | #rewind file pointer
14 | file.seek(0)
15 |
16 | print()
17 | #read individual line
18 | print(file.readline())
19 |
20 | #rewind file pointer
21 | file.seek(0)
22 | print()
23 |
24 | #read the whole file and set as lists
25 | print(file.readlines())
26 |
27 | #rewind file pointer
28 | file.seek(0)
29 | print()
30 |
31 | #access specific list set
32 | print(file.readlines()[1])
33 |
34 | #rewind file pointer
35 | file.seek(0)
36 | print()
37 |
38 | #read the lists using a for loop
39 | for employee in file.readlines():
40 | print(employee)
41 |
42 | file.close()
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/1/salesman.py:
--------------------------------------------------------------------------------
1 |
2 | #create class
3 | class Salesman:
4 | #define class variables
5 | def __init__(self , salesmanid , salesmanName , salary , contactNo):
6 | self.salesmanid = salesmanid
7 | self.salesmanName = salesmanName
8 | self.salary = salary
9 | self.contactNo = contactNo
10 |
11 | #define class functions
12 | def displaySalesmanDetails(self):
13 | print()
14 | print("Salesman ID : " + str(self.salesmanid))
15 | print("Salesman Name : " + self.salesmanName)
16 | print("Salary : " + str(self.salary))
17 | print("Contact No : " + self.contactNo)
18 |
19 | def setSalesmanContactNo(self):
20 | self.contactNo = input("Input new contact number of salesman " + str(self.salesmanid) + " : ")
21 |
22 |
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/student.py:
--------------------------------------------------------------------------------
1 | #create class
2 | class Student:
3 | #define class variables
4 | def __init__(self , studentID , studentName, marksOOC , marksSPM , marksISDM):
5 | self.studentID = studentID
6 | self.studentName = studentName
7 | self.marksOOC = marksOOC
8 | self.marksSPM = marksSPM
9 | self.marksISDM = marksISDM
10 |
11 | #define class functions
12 | def setMarksOOC(self , mOOC):
13 | self.marksOOC = mOOC
14 |
15 | def getMarksOOC(self):
16 | return (self.marksOOC)
17 |
18 | def setMarksSPM(self , mSPM):
19 | self.marksSPM = mSPM
20 |
21 | def getMarksSPM(self):
22 | return (self.marksSPM)
23 |
24 | def setMarksISDM(self , mISDM):
25 | self.marksISDM = mISDM
26 |
27 | def getMarksISDM(self):
28 | return (self.marksISDM)
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 5/main.py:
--------------------------------------------------------------------------------
1 |
2 | #get the user input for Position
3 | position = input("Position : ")
4 | while position != "M" and position != "m" and position != "S" and position != "s":
5 | print("Invalid Input")
6 | position = input("Position : ")
7 |
8 | #get the user input for sales amount
9 | sales = input("Sales amount : ")
10 | sales = float(sales)
11 |
12 | #get the basic salary by the user input
13 | if position == "M" or position == "m":
14 | basic = 50000
15 | else:
16 | basic = 75000
17 |
18 | #check the sales amount for commission
19 | if sales >= 30000:
20 | commission = sales * 10 / 100
21 | else:
22 | commission = 0
23 |
24 | #calculate the salary
25 | salary = basic + commission
26 |
27 | #display the commission and the salary
28 | print("Commission : " + str(commission))
29 | print("Salary : " + str(salary))
30 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 3/main.py:
--------------------------------------------------------------------------------
1 | maxScore = 0
2 |
3 | #get the user input for number of players
4 | noOfPlayers = input("Input the number of players : ")
5 | noOfPlayers = int(noOfPlayers)
6 |
7 | #get the details and score for each player
8 | for i in range(noOfPlayers):
9 | total = 0
10 | print()
11 | playerNo = input("Input player number : ")
12 |
13 | for j in range(3):
14 | score = input("Input score " + str(j + 1) + " : ")
15 | score = int(score)
16 | total = total + score
17 |
18 | if (maxScore < total):
19 | maxScore = total
20 | maxPlayer = playerNo
21 |
22 | #display total score of the player
23 | print("Total Score : " + str(total))
24 |
25 | print()
26 | #display the player with the highest score
27 | print("Player no : " + str(maxPlayer) + " go the highest score of " + str(maxScore))
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 5/main.py:
--------------------------------------------------------------------------------
1 | total = 0
2 |
3 | #get user input for Item number
4 | itemNo = input("Enter Item : ")
5 |
6 | while itemNo != "-99":
7 | if itemNo != "1" and itemNo != "2" and itemNo != "3":
8 | print("Invalid Item Number")
9 | #get user input for Item number
10 | itemNo = input("Enter Item : ")
11 | continue
12 |
13 | #get user input for the quantity
14 | quantity = input("Enter Quantity : ")
15 | quantity = float(quantity)
16 |
17 | if itemNo == "1":
18 | total = total + (30 * quantity)
19 | elif itemNo == "2":
20 | total = total + (45 * quantity)
21 | else:
22 | total = total + (55.50 * quantity)
23 |
24 | print()
25 | #get user input for Item number
26 | itemNo = input("Enter Item : ")
27 |
28 | #display the total price
29 | print("Total Price to pay Rs : " + str(total))
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 2/main.py:
--------------------------------------------------------------------------------
1 | total = 0
2 |
3 | #get user input for item number
4 | itemNo = input("Enter Item : ")
5 |
6 | while itemNo != "-1":
7 | #check for invalid input
8 | if itemNo != "1" and itemNo != "2" and itemNo != "3":
9 | print("Invalid Input")
10 | #get user input for item number
11 | itemNo = input("Enter Item : ")
12 | continue
13 |
14 | #take user inputs for quantity
15 | quantity = input("Enter Quantity : ")
16 | quantity = float(quantity)
17 |
18 | if itemNo == "1":
19 | total = total + (300.25 * quantity)
20 | elif itemNo == "2":
21 | total = total + (145.50 * quantity)
22 | else:
23 | total = total + (525.00 * quantity)
24 |
25 | print()
26 | #get user input for item number
27 | itemNo = input("Enter Item : ")
28 |
29 | #display total price
30 | print("Total Price to pay Rs : " + str(total))
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 1/Version 1 - Randula/main.py:
--------------------------------------------------------------------------------
1 |
2 | #take user inputs for time period
3 | timePeriod = input("Time Period : ")
4 | timePeriod = float(timePeriod)
5 |
6 | #take user inputs for number of times
7 | noOfTimes = input("Number of times : ")
8 | noOfTimes = float(noOfTimes)
9 |
10 | #take user inputs for peak time feature
11 | peakTime = input("Peak time (Y /N) : ")
12 | while peakTime != "Y" and peakTime != "y" and peakTime != "N" and peakTime != "n":
13 | print("Invalid Input! Try again!! " + peakTime)
14 | peakTime = input("Peak time (Y /N) : ")
15 |
16 | #calculate basic price
17 | if timePeriod > 60:
18 | total = 25000 * noOfTimes
19 | elif timePeriod >= 45:
20 | total = 12000 * noOfTimes
21 | else:
22 | total = 7500 * noOfTimes
23 |
24 | #calculate and add extra fee for peak time
25 | if peakTime == "Y" or peakTime == "y":
26 | total = total * 120 / 100
27 |
28 | #print output
29 | print("Total amount to be paid : " + str(total))
30 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 1/main.py:
--------------------------------------------------------------------------------
1 |
2 | #define calcIncrement function
3 | def calcIncrement(salary , noOfYearsWorked):
4 | if(noOfYearsWorked > 2):
5 | increment = (salary * 10 / 100)
6 | else:
7 | increment = 0
8 |
9 | return increment
10 |
11 | #define calcTotalSalary function
12 | def calcTotalSalary(salary , increment):
13 | total = salary + increment
14 | return total
15 |
16 | #get user inputs for salary
17 | salary = input("Enter Salary : ")
18 | salary = float(salary)
19 |
20 | #get user inputs for number of years worked
21 | years = input("Enter no of years worked : ")
22 | years = int(years)
23 |
24 | #calculate the increment by passing the given values to the function
25 | increment = calcIncrement(salary , years)
26 |
27 | #calculate the total salary by passing the given values to the function
28 | totalSalary = calcTotalSalary(salary , increment)
29 |
30 | #display the increment and the total salary
31 | print("Increment : " + str(increment))
32 | print("Total Salary : " + str(totalSalary))
33 |
--------------------------------------------------------------------------------
/Question Set 2 - (Repetition Statement)/Version 1/main.py:
--------------------------------------------------------------------------------
1 |
2 | #get user inputs for pizza type
3 | pType = input("Enter Pizza Type : ")
4 |
5 | while pType != "-1":
6 |
7 | if pType != "1" and pType != "2" and pType != "3":
8 | print("Invalid Input")
9 | print()
10 | pType = input("Enter Pizza Type : ")
11 | continue
12 |
13 | #get user input for quantity
14 | quantity = input("Enter Quantity : ")
15 | quantity = int(quantity)
16 |
17 | #calculate the total and the discount
18 | if pType == "1":
19 | total = (1000 * quantity)
20 | discount = total * 10 / 100
21 | elif pType == "2":
22 | total = (1600 * quantity)
23 | discount = total * 12 / 100
24 | else:
25 | total = (1400 * quantity)
26 | discount = total * 15 / 100
27 |
28 | if quantity > 3:
29 | total = total - discount
30 |
31 | #display the total price
32 | print("Total Price : " + str(total))
33 |
34 | print()
35 | #get user inputs for pizza type
36 | pType = input("Enter Pizza Type : ")
37 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 2/main.py:
--------------------------------------------------------------------------------
1 |
2 | #define the getDiscountPrice function
3 | def getDiscountPrice(noOfGuests , chargePerGuest):
4 | if noOfGuests > 200:
5 | discount = float(noOfGuests * chargePerGuest) * 10 / 100
6 | else:
7 | discount = 0
8 | return discount
9 |
10 | #define the getAmount function
11 | def getAmount(noOfGuests , chargePerGuest , discount):
12 | amount = (noOfGuests * chargePerGuest) - discount
13 | return amount
14 |
15 | #get user inputs for number of guests
16 | guests = input("Enter no of guests : ")
17 | guests = int(guests)
18 |
19 | #get user inputs for charge per guest
20 | charge = input("Enter charge per guest : ")
21 | charge = float(charge)
22 |
23 | #pass the given values to the getDiscountPrice function
24 | discount = getDiscountPrice(guests , charge)
25 |
26 | #pass the given values to the getAmount function
27 | amount = getAmount(guests , charge , discount)
28 |
29 | #display the discount and the amount to be paid
30 | print("Discount : " + str(discount))
31 | print("Amount to be paid : " + str(amount))
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 1/main.py:
--------------------------------------------------------------------------------
1 |
2 | #define the arrays
3 | numArr = [0 for i in range(6)]
4 | oddNum = [0 for i in range(6)]
5 | evenNum = [0 for i in range(6)]
6 |
7 | #get user inputs for numArr
8 | for i in range(6):
9 | numArr[i] = input("Enter a number : ")
10 |
11 | print()
12 |
13 |
14 | #display the user input
15 | print("Number series :" , end = " ")
16 | for i in range(6):
17 | print(numArr[i] , end = " ")
18 | print()
19 |
20 | #inizialize 2 integer variables to manipulate oddNum & evenNum arrays
21 | j = 0
22 | k = 0
23 |
24 | #assign values to oddNum & evenNum arrays
25 | for i in range(6):
26 | numArr[i] = int(numArr[i])
27 | if(numArr[i] % 2 == 1):
28 | oddNum[j] = numArr[i]
29 | j = j + 1
30 | else:
31 | evenNum[k] = numArr[i]
32 | k = k + 1
33 |
34 |
35 | #display oddNum array
36 | print("Odd Numbers :" , end = " ")
37 | for i in range(j):
38 | print(oddNum[i] , end = " ")
39 |
40 | print()
41 | #display evenNum Array
42 | print("Even Numbers :" , end = " ")
43 | for i in range(k):
44 | print(evenNum[i] , end = " ")
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 4/Version 4 - Randula/main.py:
--------------------------------------------------------------------------------
1 |
2 | #taking user inputs for package type
3 | pType = input("Package Type : ")
4 | while pType != "S" and pType != "s" and pType != "G" and pType != "g":
5 | print("Invalid Input!! Try again")
6 | pType = input("Package Type : ")
7 |
8 | #taking user inputs for food type
9 | fType = input("Food type : ")
10 | while fType != "1" and fType != "2" and fType != "3":
11 | print("Invalid Input!! Try again")
12 | fType = input("Food type : ")
13 |
14 | #taking user inputs for number of guests
15 | noOfGuests = input("Number of guests : ")
16 | noOfGuests = float(noOfGuests)
17 |
18 | #select the package price by the user input
19 | if pType == "S" or pType == "s":
20 | pPrice = 10000
21 | else:
22 | pPrice = 25000
23 |
24 | #select the food price by the user input
25 | if fType == "1":
26 | fPrice = 1000
27 | elif fType == "2":
28 | fPrice = 2000
29 | else:
30 | fPrice = 1500
31 |
32 | #calculate the total bill
33 | total = pPrice + (fPrice * noOfGuests)
34 |
35 | #display the total price
36 | print("Bill Amount : " + str(total))
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 3/main.py:
--------------------------------------------------------------------------------
1 |
2 | #define calculateWeeklySalary function
3 | def calculateWeeklySalary(grade , hrsWorked):
4 | if grade == "1":
5 | hRate = 100
6 | elif grade == "2":
7 | hRate = 200
8 | else:
9 | hRate = 300
10 |
11 | salary = hRate * hrsWorked
12 | return salary
13 |
14 | #define printDetails function
15 | def printDetails(grade , hrsWorked , salary):
16 | print()
17 | print("Grade : " + str(grade))
18 | print("Hours Worked : " + str(hrsWorked))
19 | print("Salary : " + str(salary))
20 |
21 |
22 | #get user input for grade
23 | grade = input("Enter Grade : ")
24 | while grade != "1" and grade != "2" and grade != "3":
25 | print("Invalid input!! Try Again")
26 | #get user input for grade
27 | grade = input("Enter Grade : ")
28 |
29 | #get user inputs for hours hrsWorked
30 | hrs = input("Enter Hours Worked : ")
31 | hrs = int(hrs)
32 |
33 | #pass the given values to calculateWeeklySalary function
34 | salary = calculateWeeklySalary(grade , hrs)
35 |
36 | #pass the given values to printDetails function
37 | printDetails(grade , hrs , salary)
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 2/main.py:
--------------------------------------------------------------------------------
1 |
2 | #initialize the arrays
3 | intArr = [0 for i in range(10)]
4 | positiveNum = [0 for i in range(10)]
5 | negativeNum = [0 for i in range(10)]
6 |
7 | #get user inputs
8 | for i in range(10):
9 | intArr[i] = input("Enter a number : ")
10 | intArr[i] = int(intArr[i])
11 |
12 | print()
13 |
14 | #display the user input
15 | print("Number series :" , end = " ")
16 | for i in range(10):
17 | print(str(intArr[i]) , end = " ")
18 |
19 | #inizialize 2 integer variables to manipulate oddNum & evenNum arrays
20 | j = 0
21 | k = 0
22 |
23 | #assign values to positiveNum & negativeNum arrays
24 | for i in range(10):
25 | if intArr[i] < 0:
26 | negativeNum[j] = intArr[i]
27 | j = j + 1
28 | else:
29 | positiveNum[k] = intArr[i]
30 | k = k + 1
31 |
32 |
33 | print()
34 | #display positiveNum Array
35 | print("Positive Numbers :" , end = " ")
36 | for i in range(k):
37 | print(str(positiveNum[i]) , end = " ")
38 |
39 | print()
40 | #display negativeNum Array
41 | print("Negative Numbers :" , end = " ")
42 | for i in range(j):
43 | print(str(negativeNum[i]) , end = " ")
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2021 Randula Yashasmith Mawaththa
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/Question Set 3 - (Functions)/Version 4/main.py:
--------------------------------------------------------------------------------
1 |
2 | #define calculateTotalCost function
3 | def calculateTotalCost(itemNo , quantity):
4 | if itemNo == "1":
5 | unitPrice = 100
6 | elif itemNo == "2":
7 | unitPrice = 200
8 | else:
9 | unitPrice = 300
10 |
11 | totalCost = unitPrice * quantity
12 | return totalCost
13 |
14 | #define printDetails function
15 | def printDetails(itemNo , quantity , totalCost):
16 | print()
17 | print("Item No : " + str(itemNo))
18 | print("Quantity : " + str(quantity))
19 | print("Total Cost : " + str(totalCost))
20 |
21 |
22 | #get user inputs for item no
23 | itemNo = input("Enter Item Number : ")
24 | while itemNo != "1" and itemNo != "2" and itemNo != "3":
25 | print("Invalid Input!! Try again")
26 | #get user inputs for item no
27 | itemNo = input("Enter Item Number : ")
28 |
29 | #get user inputs for quantity
30 | quantity = input("Enter quantity : ")
31 | quantity = int(quantity)
32 |
33 | #pass the given values to calculateTotalCost function
34 | totalCost = calculateTotalCost(itemNo , quantity)
35 |
36 | #pass the given values to printDetails function
37 | printDetails(itemNo , quantity , totalCost)
--------------------------------------------------------------------------------
/Question Set 4 - (Lists)/Version 3/main.py:
--------------------------------------------------------------------------------
1 |
2 | #initalize the arrays
3 | myArray = [0 for i in range(10)]
4 | largeNum = [0 for i in range(10)]
5 |
6 | #define total variable to calculate the average
7 | total = 0
8 |
9 | #get user inputs
10 | for i in range(10):
11 | myArray[i] = input("Enter the number series : ")
12 | myArray[i] = float(myArray[i])
13 |
14 | #calculate the total and the average
15 | for i in range(10):
16 | total = total + myArray[i]
17 |
18 | average = total / 10
19 |
20 | print()
21 | #display the average
22 | print("Average : " + str(average))
23 |
24 | #display the myArray elements
25 | print("myArray :" , end = " ")
26 | for i in range(10):
27 | myArray[i] = int(myArray[i])
28 | print(str(myArray[i]) , end = " ")
29 |
30 | print()
31 |
32 | #inizialize an integer variable to manipulate largerNum array
33 | j = 0
34 |
35 | #assign values greater than average to largeNum array
36 | for i in range(10):
37 | if (myArray[i] > average):
38 | largeNum[j] = myArray[i]
39 | j = j + 1
40 |
41 | #display the largeNum elements
42 | print("largeNum :" , end = " ")
43 | for i in range(5):
44 | print(str(largeNum[i]) , end = " ")
45 |
46 | print()
--------------------------------------------------------------------------------
/Question Set 5 - (Classess & Objects)/3/main.py:
--------------------------------------------------------------------------------
1 | #import file
2 | from student import Student
3 |
4 | #create objects and set student details
5 | s1 = Student(1234 , "Kamal" , 0 , 0 , 0)
6 | s2 = Student(4567 , "Saman" , 0 , 0 , 0)
7 | s3 = Student(7891 , "Nimal" , 0 , 0 , 0)
8 | s4 = Student(1212 , "Sunil" , 0 , 0 , 0)
9 |
10 | #set marks for s1
11 | s1.setMarksOOC(85)
12 | s1.setMarksSPM(80)
13 | s1.setMarksISDM(75)
14 |
15 | #set marks for s2
16 | s2.setMarksOOC(65)
17 | s2.setMarksSPM(50)
18 | s2.setMarksISDM(45)
19 |
20 | #set marks for s3
21 | s3.setMarksOOC(98)
22 | s3.setMarksSPM(75)
23 | s3.setMarksISDM(80)
24 |
25 | #set marks for s4
26 | s4.setMarksOOC(35)
27 | s4.setMarksSPM(60)
28 | s4.setMarksISDM(40)
29 |
30 |
31 | #calculate average for each module
32 | avgOOC = (s1.getMarksOOC() + s2.getMarksOOC() + s3.getMarksOOC() + s4.getMarksOOC()) / 4
33 | avgSPM = (s1.getMarksSPM() + s2.getMarksSPM() + s3.getMarksSPM() + s4.getMarksSPM()) / 4
34 | avgISDM = (s1.getMarksISDM() + s2.getMarksISDM() + s3.getMarksISDM() + s4.getMarksISDM()) / 4
35 |
36 | #display average marks
37 | print("Average OOC Marks : " + str(avgOOC))
38 | print("Average SPM Marks : " + str(avgSPM))
39 | print("Average ISDM Marks : " + str(avgISDM))
--------------------------------------------------------------------------------
/Question Set 1 - (Selection Statement)/Version 2/Version 2 - Randula/main.py:
--------------------------------------------------------------------------------
1 |
2 | #take user inputs for Item code
3 | itemCode = input("Item Code : ")
4 | while itemCode != "1" and itemCode != "2" and itemCode != "3":
5 | print("Invalid Input!! Try again")
6 | itemCode = input("Item Code : ")
7 |
8 | #take user inputs for quantity
9 | quantity = input("Quantity : ")
10 | quantity = float(quantity)
11 |
12 | #take user inputs for customer type
13 | cType = input("Customer Type (L / N) : ")
14 | while cType != "L" and cType != "l" and cType != "N" and cType != "n":
15 | print("Invalid Input!! Try again")
16 | cType = input("Customer Type (L / N) : ")
17 |
18 | #calculate basic price
19 | if itemCode == "1":
20 | total = 530 * quantity
21 | elif itemCode == "2":
22 | total = 300 * quantity
23 | elif itemCode == "3":
24 | total = 950 * quantity
25 |
26 | #calculate discount
27 | if cType == "L" or cType == "l":
28 | discount = float(total * 25 / 100)
29 | else:
30 | discount = float(total * 5 / 100)
31 |
32 | #calculate total price
33 | total = total - discount
34 |
35 | #display the discount and total
36 | print("Discount : " + str(discount))
37 | print("Total bill after the discount : " + str(total))
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/11.1 - while.py:
--------------------------------------------------------------------------------
1 | count = 0
2 | total = 0
3 | marks = 0
4 | average = 0
5 |
6 | marks = input("Enter Marks (-10 to end): ")
7 | marks = float(marks)
8 | while (marks != -10):
9 | if (marks >= 0) and (marks <= 100):
10 | total += marks
11 | count += 1
12 | marks = input("Enter Marks (-10 to end): ")
13 | marks = int(marks)
14 | else:
15 | print("Invalid Value!! Enter a number between 0 - 100")
16 | marks = input("Enter Marks (-10 to end): ")
17 | marks = int(marks)
18 |
19 | #count = float(count)
20 | average = total / count
21 | #average = float (marks / count)
22 | print()
23 |
24 | #average = 1035
25 | print("Total = " + str(total) + " Count = " + str(count))
26 |
27 | print("Average is " + str(average))
28 |
29 | if (average >= 90):
30 | grade = "A+"
31 | elif (average >= 80):
32 | grade = "A"
33 | elif (average >= 75):
34 | grade = "A-"
35 | elif (average >= 70):
36 | grade = "B+"
37 | elif (average >= 65):
38 | grade = "B"
39 | elif (average >= 60):
40 | grade = "B-"
41 | elif (average >= 55):
42 | grade = "C+"
43 | elif (average >= 45):
44 | grade = "C"
45 | elif (average >= 40):
46 | grade = "C-"
47 | else:
48 | grade = "D"
49 |
50 | print("Grade is : " + grade)
51 |
--------------------------------------------------------------------------------
/Basic Python Theory/Part 1 (Basic Syntax)/05 - listFunctions.py:
--------------------------------------------------------------------------------
1 | print("Start")
2 | list = ['One' , 'Two' , 'Three' , 'Four' , 'Five' , 'Six' , 'Seven' , 'Eight' , 'Nine' , 'Ten']
3 | number = [1 , 4 , 8 , 6 , 9 , 7 , 3 , 10 , 2 , 5]
4 | same = [1 , 5 , 3 , 1 , 5 , 6 , 4 , 1 , 8]
5 |
6 | print(list)
7 | print(number)
8 | print()
9 |
10 | print("Extend")
11 | #combine lists(extend)
12 | list.extend(number)
13 | print(list)
14 | list = ['One' , 'Two' , 'Three' , 'Four' , 'Five' , 'Six' , 'Seven' , 'Eight' , 'Nine' , 'Ten']
15 | print()
16 |
17 | print("Append")
18 | #insert new data at the end (append)
19 | list.append("Add")
20 | print(list)
21 | print()
22 |
23 | print("Insert")
24 | #insert new data to the middle (insert)
25 | list.insert(1 , "Break")
26 | print(list)
27 | print()
28 |
29 | print("Remove")
30 | #remove data (remove)
31 | list.remove("Add")
32 | list.remove("Break")
33 | print(list)
34 | print()
35 |
36 | print("Clear")
37 | #remove all data (clear)
38 | list.clear()
39 | print(list)
40 | list = ['One' , 'Two' , 'Three' , 'Four' , 'Five' , 'Six' , 'Seven' , 'Eight' , 'Nine' , 'Ten']
41 | #remove last one
42 | list.pop()
43 | print(list)
44 | print()
45 | list = ['One' , 'Two' , 'Three' , 'Four' , 'Five' , 'Six' , 'Seven' , 'Eight' , 'Nine' , 'Ten']
46 |
47 | #index check
48 | print(list.index('One'))
49 | print(number.index(10))
50 | print()
51 |
52 | #count elements
53 | print(same)
54 | print(same.count(1))
55 | print()
56 |
57 | #sort element
58 | same.sort()
59 | print(same)
60 | print()
61 |
62 | #reverse order
63 | same.reverse()
64 | print(same)
65 | print()
66 |
67 | #copy a list
68 | number_set = same.copy()
69 | print(number_set)
70 | print()
71 |
72 | number_set.reverse()
73 | print(number_set)
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Python For Beginners
2 |
3 |
Python Programming Language
4 |
5 | 
6 | 
7 | 
8 | 
9 | 
10 | 
11 | 
12 | 
13 | 
14 | 
15 | 
16 |
17 |
18 | 
19 |
20 |
21 | :diamonds: Python is a very powerful and user friendly programming language. :snowflake:
22 | :diamonds: There are some basic sytaxes and indentation rules you need to understand to learn python. :cat:
23 |
24 |
25 | #
26 |
27 |
28 | 🔵 This Repository will help you to learn Python programming language from the beginnning.🔆
29 | 🔵 Everyone is welcome to contribute. :couple:
30 | 🔵 Image courtesy goes to ThusharaX/C-programming .👨🏻 💻
31 | 🔵 Happy Coding folks.. 😄
32 |
33 |
34 | #
35 |
36 |
37 | 🔵 Download Python 3.10 - 👉🏻 Click Here 👈🏻
38 | 🔵 Use Pycharm IDE - 👉🏻 Click Here 👈🏻
39 |
40 |
57 |
--------------------------------------------------------------------------------