Welcome to the Python ํ์ต ๋ฐ ์ฝ๋ ์ ๋ฆฌ repository! This project aims to provide a comprehensive collection of Python code examples and exercises, organized by week. Whether you're a beginner looking to understand Python fundamentals or someone looking to refine your skills, this repository is designed to help you learn and practice effectively.
- โจ Weekly Code Examples: A structured approach to learning Python with weekly organized examples.
- ๐ Practical Exercises: Hands-on exercises to reinforce your understanding of Python concepts.
- ๐ง Comprehensive Documentation: Detailed explanations and examples for each topic covered.
Ensure you have the following installed:
-
Clone the repository:
git clone https://github.com/umyunsang/Python.git cd Python -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
Here's a basic example of how to use the code examples provided in this repository:
import week1.and_or_notresult = week1.and_or_not.some_function()
print(result)
and_or_not.py: ๋ ผ๋ฆฌ ์ฐ์ฐ์ AND, OR, NOT์ ์ฌ์ฉ๋ฒ์ ์ค๋ช ํ๋ ์ฝ๋ ์์ f_string_usage.py: f-string์ ์ฌ์ฉํ ๋ฌธ์์ด ํฌ๋งคํ ์์ input_example.py: ์ฌ์ฉ์ ์ ๋ ฅ์ ์ฒ๋ฆฌํ๋ ๋ฐฉ๋ฒ์ ๋ํ ์์ operator_examples.py: ๋ค์ํ ์ฐ์ฐ์์ ์ฌ์ฉ ์์ tuple_example.py: ํํ์ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ ๋ฐ ์์
compound_example.py: ๋ณตํฉ ์๋ฃํ ์์ floating_point.py: ๋ถ๋ ์์์ ์ซ์์ ์ฒ๋ฆฌ ์์ if_statement.py: ์กฐ๊ฑด๋ฌธ (IF)์ ์ฌ์ฉ ์์ indentation_examples.py: ํ์ด์ฌ ์ฝ๋์ ๋ค์ฌ์ฐ๊ธฐ ๊ท์น ์์ string_basics.py: ๋ฌธ์์ด์ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ๊ณผ ์์
age_check.py: ๋์ด ํ์ธ ํ๋ก๊ทธ๋จ ์์ book_lending.py: ๋์ ๋์ถ ์์คํ ์์ factorial.py: ํฉํ ๋ฆฌ์ผ ๊ณ์ฐ ์์ for_loop_basics.py: FOR ๋ฃจํ์ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ ์์ random_number.py: ๋๋ค ์ซ์ ์์ฑ ์์ rps_game.py: ๊ฐ์ ๋ฐ์ ๋ณด ๊ฒ์ ์์ week3_project.py: 3์ฃผ์ฐจ ํ๋ก์ ํธ ์์
for_continue.py: FOR ๋ฃจํ์ CONTINUE ๋ฌธ ์์ for_vs_while.py: FOR ๋ฃจํ์ WHILE ๋ฃจํ์ ๋น๊ต ์์ gugudan.py: ๊ตฌ๊ตฌ๋จ ์ถ๋ ฅ ์์ pi.py: ์์ฃผ์จ ๊ณ์ฐ ์์ random_dice.py: ์ฃผ์ฌ์ ๋กค ์์ range_odd_sum.py: ๋ฒ์ ๋ด ํ์ ํฉ๊ณ ์์ while_basic.py: WHILE ๋ฃจํ์ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ ์์
food_order.py: ์์ ์ฃผ๋ฌธ ์์คํ ์์ indexing.py: ๋ฆฌ์คํธ ์ธ๋ฑ์ฑ ์์ list_append.py: ๋ฆฌ์คํธ์ ํญ๋ชฉ ์ถ๊ฐ ์์ list_basic.py: ๋ฆฌ์คํธ์ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ ์์ list_methods.py: ๋ฆฌ์คํธ ๋ฉ์๋ ์์ negative_index.py: ์์ ์ธ๋ฑ์ค ์ฌ์ฉ ์์ remove_and_del.py: ํญ๋ชฉ ์ ๊ฑฐ ๋ฐ ์ญ์ ์์ replacement.py: ๋ฆฌ์คํธ ํญ๋ชฉ ๊ต์ฒด ์์ slicing.py: ๋ฆฌ์คํธ ์ฌ๋ผ์ด์ฑ ์์
diagonal_sums.py: ํ๋ ฌ์ ๋๊ฐ์ ํฉ ๊ณ์ฐ ์์ dict_basic.py: ๋์ ๋๋ฆฌ์ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ ์์ minesweeper.py: ์ง๋ขฐ ์ฐพ๊ธฐ ๊ฒ์ ์์ nested_list.py: ์ค์ฒฉ ๋ฆฌ์คํธ์ ์ฌ์ฉ ์์
function.py: ํจ์์ ๊ธฐ๋ณธ ์ฌ์ฉ๋ฒ ์์ function_output_and_input.py: ํจ์์ ์ ๋ ฅ๊ณผ ์ถ๋ ฅ ์์ parameter.py: ํจ์์ ๋งค๊ฐ๋ณ์ ์ฌ์ฉ ์์
closure_ex.py: ํด๋ก์ ์์ global_key.py: ๊ธ๋ก๋ฒ ๋ณ์์ ํค ์์ global_var_ex.py: ๊ธ๋ก๋ฒ ๋ณ์ ์ฌ์ฉ ์์ list_comprehension.py: ๋ฆฌ์คํธ ์ปดํ๋ฆฌํจ์ ์์ simple_func.py: ๊ฐ๋จํ ํจ์ ์์
filter_and_sort.py: ํํฐ๋ง ๋ฐ ์ ๋ ฌ ์์
check_string.py: ๋ฌธ์์ด ์ฒดํฌ ์์ collatz_steps.py: ์ฝ๋ผ์ธ ๋จ๊ณ ์์ count_p_y.py: ๋ฌธ์ 'p'์ 'y'์ ๊ฐ์ ์ธ๊ธฐ ์์ dedup.py: ์ค๋ณต ์ ๊ฑฐ ์์ divisor_filter.py: ์ฝ์ ํํฐ๋ง ์์ dot_product.py: ๋ฒกํฐ์ ๋ด์ ๊ณ์ฐ ์์ find_middle_char.py: ๋ฌธ์์ด์ ์ค๊ฐ ๋ฌธ์ ์ฐพ๊ธฐ ์์ generate_sequence.py: ์ํ์ค ์์ฑ ์์ harshad_number.py: ํ์ค๋ ์ ๊ณ์ฐ ์์ mask_phone_number.py: ์ ํ๋ฒํธ ๋ง์คํน ์์ missing_digit_sum.py: ๋๋ฝ๋ ์ซ์ ํฉ๊ณ ๊ณ์ฐ ์์ print_rectangle.py: ์ง์ฌ๊ฐํ ์ถ๋ ฅ ์์ signed_numbers_sum.py: ๋ถํธ ์๋ ์ซ์์ ํฉ๊ณ ์์ sort_digits.py: ์ซ์ ์ ๋ ฌ ์์ sum_array.py: ๋ฐฐ์ด์ ํฉ๊ณ ๊ณ์ฐ ์์ sum_range.py: ๋ฒ์ ๋ด ํฉ๊ณ ๊ณ์ฐ ์์ toggle_case.py: ๋ฌธ์ ๋์๋ฌธ์ ์ ํ ์์
file_io_basic.py: ํ์ผ ์ ์ถ๋ ฅ ๊ธฐ๋ณธ ์์ file_read.py: ํ์ผ ์ฝ๊ธฐ ์์ file_read_lines.py: ํ์ผ์ ๊ฐ ๋ผ์ธ ์ฝ๊ธฐ ์์ file_write.py: ํ์ผ ์ฐ๊ธฐ ์์ myfile.txt: ์์ ํ ์คํธ ํ์ผnewfile.txt: ์ ํ ์คํธ ํ์ผ
breakout_game.py: ๋ธ๋ ์ดํฌ์์ ๊ฒ์ ์์ class_car.py: ์๋์ฐจ ํด๋์ค ์์ library_system.py: ๋์๊ด ์์คํ ์์
dice_score.py: ์ฃผ์ฌ์ ์ ์ ๊ณ์ฐ ์์ list_overlap.py: ๋ฆฌ์คํธ ์ค๋ณต ํญ๋ชฉ ํ์ธ ์์ lottery_check.py: ๋ก๋ ๋ฒํธ ํ์ธ ์์ lottery_select.py: ๋ก๋ ๋ฒํธ ์ ํ ์์ str_matching.py: ๋ฌธ์์ด ๋งค์นญ ์์
Contributions are welcome! Please follow these steps to contribute:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch). - Make your changes.
- Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature-branch). - Open a pull request.
Please make sure to update tests as appropriate.
To run tests, use the following command:
pytestFor questions or support, please reach out to dbstkd5865l@gmail.com.