Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6730da4

Browse files
Add detailed sections to README.md and various code snippet files
* **README.md**: - Add a section describing the project, its purpose, and unique features. - Add a section explaining the technologies used and their benefits. - Add a section with instructions on how to run the project locally. - Add a section with contribution guidelines. * **add_key_to_dictionary.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **binary_divisibility.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **binaryConvertor.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **calculate_average.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **calculate_distance.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **calculate_electricity_bill.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **calculate_gross_salary.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **calculate_sum_of_digits.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **character_checker.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **check_for_duplicates.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **check_key_in_dictionary.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **check_prime_number.md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output. * **check_sublist_presence().md**: - Add a section explaining the purpose of the code snippet. - Add a section with detailed instructions on how to run the code. - Add a section with example usage and expected output.
1 parent 9215492 commit 6730da4

File tree

20 files changed

+552
-74
lines changed

20 files changed

+552
-74
lines changed

‎README.md

Lines changed: 78 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,87 @@
55
<h1 align="center">CSE3011-Python-Programming</h1>
66
</p>
77

8+
## Result
89

9-
Welcome to the CS360 Python Programming repository! This repository contains all the course material and assignments for CSE3011-Python-Programming at VIT Bhopal University.
10+
Here are my scores:
11+
![Result](https://github.com/Pulkit1822/CSE3011-Python-Programming/blob/main/main/result.png)
1012

13+
## Project Description
14+
15+
This project is a comprehensive collection of Python programming assignments and course materials for the CSE3011-Python-Programming course at VIT Bhopal University. The repository is designed to help students learn and practice Python programming concepts through various assignments and examples. Each assignment is well-documented with a README.md file that explains the purpose of the assignment, how to run the code, and the expected output.
16+
17+
### Unique Features
18+
19+
- **Well-Organized Structure**: Each assignment has its own directory with a README.md file, making it easy to navigate and understand the content.
20+
- **Comprehensive Examples**: The repository covers a wide range of Python programming concepts, from basic to advanced topics.
21+
- **Detailed Documentation**: Each assignment is accompanied by detailed documentation, including code analysis, inputs, flow, and outputs.
22+
- **Practical Assignments**: The assignments are designed to provide hands-on experience and reinforce the concepts learned in the course.
23+
24+
## Technologies Used
25+
26+
This project utilizes the following technologies:
27+
28+
- **Python**: The primary programming language used for all assignments and examples.
29+
- **Markdown**: Used for creating detailed documentation and README.md files for each assignment.
30+
- **Git**: Version control system used to manage the repository and track changes.
31+
32+
### Benefits of Technologies
33+
34+
- **Python**: Python is a versatile and widely-used programming language that is easy to learn and has a large community of developers. It is suitable for a wide range of applications, from web development to data analysis.
35+
- **Markdown**: Markdown is a lightweight markup language that allows for easy formatting of text documents. It is widely used for creating documentation and README files.
36+
- **Git**: Git is a powerful version control system that allows for efficient collaboration and tracking of changes in a project. It is essential for managing code repositories and ensuring the integrity of the project.
37+
38+
## Running the Project Locally
39+
40+
To run the project on your local system, follow these steps:
41+
42+
1. **Clone the Repository**: Clone the repository to your local machine using the following command:
43+
```bash
44+
git clone https://github.com/Pulkit1822/CSE3011-Python-Programming.git
45+
```
46+
47+
2. **Navigate to the Project Directory**: Change to the project directory using the following command:
48+
```bash
49+
cd CSE3011-Python-Programming
50+
```
51+
52+
3. **Install Python**: Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
53+
54+
4. **Run the Code**: Navigate to the directory of the assignment you want to run and execute the Python script using the following command:
55+
```bash
56+
python <script_name>.py
57+
```
58+
59+
5. **Follow the Instructions**: Follow the instructions provided in the README.md file of the assignment to understand the inputs and expected outputs.
60+
61+
## Contribution Guidelines
62+
63+
I welcome contributions from the community to improve this repository. If you would like to contribute, please follow these guidelines:
64+
65+
1. **Fork the Repository**: Fork the repository to your GitHub account using the "Fork" button at the top right corner of the repository page.
66+
67+
2. **Create a New Branch**: Create a new branch for your changes using the following command:
68+
```bash
69+
git checkout -b <branch_name>
70+
```
71+
72+
3. **Make Your Changes**: Make the necessary changes to the code or documentation.
73+
74+
4. **Commit Your Changes**: Commit your changes with a descriptive commit message using the following command:
75+
```bash
76+
git commit -m "Description of your changes"
77+
```
78+
79+
5. **Push Your Changes**: Push your changes to your forked repository using the following command:
80+
```bash
81+
git push origin <branch_name>
82+
```
83+
84+
6. **Create a Pull Request**: Create a pull request to the main repository with a description of your changes. The repository maintainers will review your pull request and merge it if it meets the contribution guidelines.
85+
86+
Thank you for your contributions!
1187

12-
The code is well-organized and each assignment has its own README.md file that explains what the assignment is about, how to run the code, and what the expected output is.
1388

14-
I hope you find this repository useful for your studies. If you have any questions or suggestions, please let me know by creating an issue in this repository.
1589

1690
---
1791

@@ -43,4 +117,4 @@ Happy learning and coding!
43117

44118
If you find this repository useful, don't forget to star it! ⭐️
45119

46-
### Written by [Pulkit](https://github.com/Pulkit1822)
120+
### Written by [Pulkit](https://github.com/Pulkit1822)

‎add_key_to_dictionary/add_key_to_dictionary.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,25 @@ ___
2222
### Outputs
2323
- `d`: the updated dictionary with the new key-value pair added.
2424
___
25+
26+
## Purpose
27+
The purpose of this code snippet is to demonstrate how to add a key-value pair to a dictionary in Python. It allows the user to interactively input a key and a value, and then updates the dictionary with the new key-value pair. This is a fundamental operation in Python programming and is useful for managing and organizing data in a dictionary.
28+
29+
## Instructions to Run the Code
30+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
31+
2. Copy the code snippet into a Python file, for example, `add_key_to_dictionary.py`.
32+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
33+
4. Run the Python file using the following command:
34+
```bash
35+
python add_key_to_dictionary.py
36+
```
37+
5. Follow the prompts to enter a key and a value. The updated dictionary will be printed as the output.
38+
39+
## Example Usage and Expected Output
40+
When you run the code, you will be prompted to enter a key and a value. For example:
41+
```python
42+
Enter key: 2
43+
Enter value: 30
44+
{0: 10, 1: 20, 2: 30}
45+
```
46+
In this example, the user enters the key `2` and the value `30`. The updated dictionary `{0: 10, 1: 20, 2: 30}` is printed as the output.

‎binaryConvertor/binaryConvertor.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,25 @@ for i in range(len(bin_num)):
2222
dec_num += int(bin_num[-(i+1)])*(2**i)
2323

2424
print("Decimal number is:", dec_num)
25+
```
26+
27+
## Purpose
28+
The purpose of this code snippet is to demonstrate how to convert a binary number to its decimal equivalent in Python. It allows the user to input a binary number and then calculates and prints the corresponding decimal number. This is a fundamental operation in computer science and is useful for understanding how binary and decimal number systems work.
29+
30+
## Instructions to Run the Code
31+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
32+
2. Copy the code snippet into a Python file, for example, `binaryConvertor.py`.
33+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
34+
4. Run the Python file using the following command:
35+
```bash
36+
python binaryConvertor.py
37+
```
38+
5. Follow the prompt to enter a binary number. The decimal equivalent of the binary number will be printed as the output.
39+
40+
## Example Usage and Expected Output
41+
When you run the code, you will be prompted to enter a binary number. For example:
42+
```python
43+
Enter binary number: 1010
44+
Decimal number is: 10
45+
```
46+
In this example, the user enters the binary number `1010`. The decimal equivalent `10` is printed as the output.

‎binary_divisibility/binary_divisibility.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,24 @@ ___
2424
### Outputs
2525
- A string containing the binary numbers from the input list that are divisible by 5.
2626
___
27+
28+
## Purpose
29+
The purpose of this code snippet is to demonstrate how to check the divisibility of binary numbers by 5. It allows the user to input a list of binary numbers and returns the binary numbers that are divisible by 5. This is useful for understanding how to work with binary numbers and perform divisibility checks in Python.
30+
31+
## Instructions to Run the Code
32+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
33+
2. Copy the code snippet into a Python file, for example, `binary_divisibility.py`.
34+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
35+
4. Run the Python file using the following command:
36+
```bash
37+
python binary_divisibility.py
38+
```
39+
5. Follow the prompt to enter a comma-separated list of 4-digit binary numbers. The binary numbers that are divisible by 5 will be printed as the output.
40+
41+
## Example Usage and Expected Output
42+
When you run the code, you will be prompted to enter a comma-separated list of 4-digit binary numbers. For example:
43+
```python
44+
Enter comma separated 4 digit binary numbers: 1010,1100,1111,1001
45+
1010
46+
```
47+
In this example, the user enters the binary numbers `1010`, `1100`, `1111`, and `1001`. The binary number `1010` is divisible by 5, so it is printed as the output.

‎calculate_average/calculate_average.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,27 @@ ___
2323
### Outputs
2424
- `average`: a float representing the average of the students' marks.
2525
___
26+
27+
## Purpose
28+
The purpose of this code snippet is to demonstrate how to calculate the average of a given number of students' marks in Python. It allows the user to input the number of students and their respective marks, and then calculates and prints the average. This is a fundamental operation in Python programming and is useful for understanding how to work with loops and arithmetic operations.
29+
30+
## Instructions to Run the Code
31+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
32+
2. Copy the code snippet into a Python file, for example, `calculate_average.py`.
33+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
34+
4. Run the Python file using the following command:
35+
```bash
36+
python calculate_average.py
37+
```
38+
5. Follow the prompt to enter the number of students and their respective marks. The average of the students' marks will be printed as the output.
39+
40+
## Example Usage and Expected Output
41+
When you run the code, you will be prompted to enter the number of students and their respective marks. For example:
42+
```python
43+
Enter the number of students: 3
44+
Enter student's mark: 85
45+
Enter student's mark: 90
46+
Enter student's mark: 78
47+
The average marks of 3 students is: 84.33333333333333
48+
```
49+
In this example, the user enters the number of students as `3` and their respective marks as `85`, `90`, and `78`. The average marks `84.33333333333333` is printed as the output.

‎calculate_distance/calculate_distance.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,28 @@ ___
2525
### Outputs
2626
- `distance` (int): The calculated distance traveled based on the given movements.
2727
___
28+
29+
## Purpose
30+
The purpose of this code snippet is to demonstrate how to calculate the distance traveled based on a series of movements in Python. It allows the user to input a list of movements and then calculates and prints the distance from the origin. This is a fundamental operation in Python programming and is useful for understanding how to work with loops, conditionals, and arithmetic operations.
31+
32+
## Instructions to Run the Code
33+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
34+
2. Copy the code snippet into a Python file, for example, `calculate_distance.py`.
35+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
36+
4. Run the Python file using the following command:
37+
```bash
38+
python calculate_distance.py
39+
```
40+
5. Follow the prompt to enter a series of movements. The distance traveled based on the movements will be printed as the output.
41+
42+
## Example Usage and Expected Output
43+
When you run the code, you will be prompted to enter a series of movements. For example:
44+
```python
45+
Enter movement (or 'STOP' to end input): UP 5
46+
Enter movement (or 'STOP' to end input): RIGHT 3
47+
Enter movement (or 'STOP' to end input): DOWN 2
48+
Enter movement (or 'STOP' to end input): LEFT 1
49+
Enter movement (or 'STOP' to end input): STOP
50+
5
51+
```
52+
In this example, the user enters the movements `UP 5`, `RIGHT 3`, `DOWN 2`, and `LEFT 1`. The calculated distance `5` is printed as the output.

‎calculate_electricity_bill/calculate_electricity_bill.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,24 @@ ___
2626
### Outputs
2727
- total_bill: a float representing the total electricity bill, including the surcharge.
2828
___
29+
30+
## Purpose
31+
The purpose of this code snippet is to demonstrate how to calculate the electricity bill based on the number of units consumed. It allows the user to input the number of units and then calculates and prints the total bill, including the surcharge. This is a practical example of how to work with conditionals and arithmetic operations in Python.
32+
33+
## Instructions to Run the Code
34+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
35+
2. Copy the code snippet into a Python file, for example, `calculate_electricity_bill.py`.
36+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
37+
4. Run the Python file using the following command:
38+
```bash
39+
python calculate_electricity_bill.py
40+
```
41+
5. Follow the prompt to enter the number of units consumed. The total electricity bill, including the surcharge, will be printed as the output.
42+
43+
## Example Usage and Expected Output
44+
When you run the code, you will be prompted to enter the number of units consumed. For example:
45+
```python
46+
Enter the number of units consumed: 100
47+
The total electricity bill is: Rs. 82.50
48+
```
49+
In this example, the user enters the number of units consumed as `100`. The total electricity bill `Rs. 82.50` is printed as the output.

‎calculate_gross_salary/calculate_gross_salary.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,31 @@ ___
2222
### Outputs
2323
- The function prints the breakdown of the salary components, including the basic salary, DA, HRA, net salary, PPF deduction, and gross salary.
2424
___
25+
26+
## Purpose
27+
The purpose of this code snippet is to demonstrate how to calculate the gross salary of an employee based on their basic salary. It allows the user to input the basic salary and then calculates and prints the various components of the salary, including the house rent allowance (HRA), dearness allowance (DA), net salary, provident fund (PPF) deduction, and gross salary. This is a practical example of how to work with conditionals and arithmetic operations in Python.
28+
29+
## Instructions to Run the Code
30+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
31+
2. Copy the code snippet into a Python file, for example, `calculate_gross_salary.py`.
32+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
33+
4. Run the Python file using the following command:
34+
```bash
35+
python calculate_gross_salary.py
36+
```
37+
5. Follow the prompt to enter the basic salary. The breakdown of the salary components, including the gross salary, will be printed as the output.
38+
39+
## Example Usage and Expected Output
40+
When you run the code, you will be prompted to enter the basic salary. For example:
41+
```python
42+
Basic salary: 15000
43+
Basic Salary : 15000.00
44+
DA : 13500.00
45+
HRA : 3750.00
46+
-----------------------------------------
47+
Net salary : 32250.00
48+
PPF : -3225.00
49+
-----------------------------------------
50+
Gross Salary : 29025.00
51+
```
52+
In this example, the user enters the basic salary as `15000`. The breakdown of the salary components, including the gross salary `29025.00`, is printed as the output.

‎calculate_sum_of_digits/calculate_sum_of_digits.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,24 @@ ___
2828
### Outputs
2929
- A list of integers representing the sum of digits for each number in the input list.
3030
___
31+
32+
## Purpose
33+
The purpose of this code snippet is to demonstrate how to calculate the sum of digits for each number in a list of numbers in Python. It allows the user to input a list of numbers, and then calculates and prints the sum of digits for each number. This is a fundamental operation in Python programming and is useful for understanding how to work with loops and arithmetic operations.
34+
35+
## Instructions to Run the Code
36+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
37+
2. Copy the code snippet into a Python file, for example, `calculate_sum_of_digits.py`.
38+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
39+
4. Run the Python file using the following command:
40+
```bash
41+
python calculate_sum_of_digits.py
42+
```
43+
5. Follow the prompt to enter a list of numbers separated by commas. The sum of digits for each number in the list will be printed as the output.
44+
45+
## Example Usage and Expected Output
46+
When you run the code, you will be prompted to enter a list of numbers separated by commas. For example:
47+
```python
48+
Enter the list of numbers separated by comma: 123, 45, 678
49+
[6, 9, 21]
50+
```
51+
In this example, the user enters the list of numbers `123`, `45`, and `678`. The sum of digits for each number `[6, 9, 21]` is printed as the output.

‎character_checker/character_checker.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,24 @@ ___
2121
### Outputs
2222
- None
2323
___
24+
25+
## Purpose
26+
The purpose of this code snippet is to demonstrate how to check the type of a given character in Python. It allows the user to input a character and then determines whether the character is an alphabet, a digit, or a special symbol. This is a fundamental operation in Python programming and is useful for understanding how to work with conditionals and string methods.
27+
28+
## Instructions to Run the Code
29+
1. Ensure that Python is installed on your system. You can download and install Python from the official website: [Python.org](https://www.python.org/)
30+
2. Copy the code snippet into a Python file, for example, `character_checker.py`.
31+
3. Open a terminal or command prompt and navigate to the directory where the Python file is saved.
32+
4. Run the Python file using the following command:
33+
```bash
34+
python character_checker.py
35+
```
36+
5. Follow the prompt to enter a character. The type of the character will be printed as the output.
37+
38+
## Example Usage and Expected Output
39+
When you run the code, you will be prompted to enter a character. For example:
40+
```python
41+
Enter a character: A
42+
The character 'A' is an alphabet.
43+
```
44+
In this example, the user enters the character `A`. The message "The character 'A' is an alphabet." is printed as the output.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /