-
Notifications
You must be signed in to change notification settings - Fork 12.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'geekcomputers:master' into testing
- Loading branch information
Showing
26 changed files
with
552 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
numpy==1.26.2 | ||
numpy==1.26.4 | ||
opencv_python==4.9.0.80 | ||
mediapipe==0.10.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
# Laundry Service Class | ||
|
||
## Overview | ||
The LaundryService class is designed to manage customer details and calculate charges for a cloth and apparel cleaning service. It provides methods to create customer-specific instances, print customer details, calculate charges based on cloth type, branding, and season, and print final details including the expected day of return. | ||
|
||
## Class Structure | ||
### Methods | ||
1. `__init__(name, contact, email, cloth_type, branded, season)`: Initializes a new customer instance with the provided details and assigns a unique customer ID. | ||
- Parameters: | ||
- `name`: String, name of the customer. | ||
- `contact`: Numeric (integer), contact number of the customer. | ||
- `email`: Alphanumeric (string), email address of the customer. | ||
- `cloth_type`: String, type of cloth deposited (Cotton, Silk, Woolen, or Polyester). | ||
- `branded`: Boolean (0 or 1), indicating whether the cloth is branded. | ||
- `season`: String, season when the cloth is deposited (Summer or Winter). | ||
|
||
2. `customerDetails()`: Prints out the details of the customer, including name, contact number, email, cloth type, and whether the cloth is branded. | ||
|
||
3. `calculateCharge()`: Calculates the charge based on the type of cloth, branding, and season. | ||
- Returns: | ||
- Numeric, total charge for cleaning the cloth. | ||
|
||
4. `finalDetails()`: Calls `customerDetails()` and `calculateCharge()` methods within itself and prints the total charge and the expected day of return. | ||
- Prints: | ||
- Total charge in Rupees. | ||
- Expected day of return (4 days if total charge > 200, otherwise 7 days). | ||
|
||
## Example Usage | ||
```python | ||
# Example usage: | ||
name = input("Enter customer name: ") | ||
contact = int(input("Enter contact number: ")) | ||
email = input("Enter email address: ") | ||
cloth_type = input("Enter cloth type (Cotton/Silk/Woolen/Polyester): ") | ||
branded = bool(int(input("Is the cloth branded? (Enter 0 for No, 1 for Yes): "))) | ||
season = input("Enter season (Summer/Winter): ") | ||
|
||
customer = LaundryService(name, contact, email, cloth_type, branded, season) | ||
customer.finalDetails() | ||
|
||
|
||
markdown | ||
Copy code | ||
# Laundry Service Class | ||
|
||
## Overview | ||
The LaundryService class is designed to manage customer details and calculate charges for a cloth and apparel cleaning service. It provides methods to create customer-specific instances, print customer details, calculate charges based on cloth type, branding, and season, and print final details including the expected day of return. | ||
|
||
## Class Structure | ||
### Methods | ||
1. `__init__(name, contact, email, cloth_type, branded, season)`: Initializes a new customer instance with the provided details and assigns a unique customer ID. | ||
- Parameters: | ||
- `name`: String, name of the customer. | ||
- `contact`: Numeric (integer), contact number of the customer. | ||
- `email`: Alphanumeric (string), email address of the customer. | ||
- `cloth_type`: String, type of cloth deposited (Cotton, Silk, Woolen, or Polyester). | ||
- `branded`: Boolean (0 or 1), indicating whether the cloth is branded. | ||
- `season`: String, season when the cloth is deposited (Summer or Winter). | ||
|
||
2. `customerDetails()`: Prints out the details of the customer, including name, contact number, email, cloth type, and whether the cloth is branded. | ||
|
||
3. `calculateCharge()`: Calculates the charge based on the type of cloth, branding, and season. | ||
- Returns: | ||
- Numeric, total charge for cleaning the cloth. | ||
|
||
4. `finalDetails()`: Calls `customerDetails()` and `calculateCharge()` methods within itself and prints the total charge and the expected day of return. | ||
- Prints: | ||
- Total charge in Rupees. | ||
- Expected day of return (4 days if total charge > 200, otherwise 7 days). | ||
|
||
## Example Usage | ||
```python | ||
# Example usage: | ||
name = input("Enter customer name: ") | ||
contact = int(input("Enter contact number: ")) | ||
email = input("Enter email address: ") | ||
cloth_type = input("Enter cloth type (Cotton/Silk/Woolen/Polyester): ") | ||
branded = bool(int(input("Is the cloth branded? (Enter 0 for No, 1 for Yes): "))) | ||
season = input("Enter season (Summer/Winter): ") | ||
|
||
customer = LaundryService(name, contact, email, cloth_type, branded, season) | ||
customer.finalDetails() | ||
Usage Instructions | ||
Create an instance of the LaundryService class by providing customer details as parameters to the constructor. | ||
Use the finalDetails() method to print the customer details along with the calculated charge and expected day of return. | ||
|
||
|
||
Contributors | ||
(Rohit Raj)[https://github.com/MrCodYrohit] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
id=1 | ||
class LaundryService: | ||
def __init__(self,Name_of_customer,Contact_of_customer,Email,Type_of_cloth,Branded,Season,id): | ||
self.Name_of_customer=Name_of_customer | ||
self.Contact_of_customer=Contact_of_customer | ||
self.Email=Email | ||
self.Type_of_cloth=Type_of_cloth | ||
self.Branded=Branded | ||
self.Season=Season | ||
self.id=id | ||
|
||
def customerDetails(self): | ||
print("The Specific Details of customer:") | ||
print("customer ID: ",self.id) | ||
print("customer name:", self.Name_of_customer) | ||
print("customer contact no. :", self.Contact_of_customer) | ||
print("customer email:", self.Email) | ||
print("type of cloth", self.Type_of_cloth) | ||
if self.Branded == 1: | ||
a=True | ||
else: | ||
a=False | ||
print("Branded", a) | ||
def calculateCharge(self): | ||
a=0 | ||
if self.Type_of_cloth=="Cotton": | ||
a=50.0 | ||
elif self.Type_of_cloth=="Silk": | ||
a=30.0 | ||
elif self.Type_of_cloth=="Woolen": | ||
a=90.0 | ||
elif self.Type_of_cloth=="Polyester": | ||
a=20.0 | ||
if self.Branded==1: | ||
a=1.5*(a) | ||
else: | ||
pass | ||
if self.Season=="Winter": | ||
a=0.5*a | ||
else: | ||
a=2*a | ||
print(a) | ||
return a | ||
def finalDetails(self): | ||
self.customerDetails() | ||
print("Final charge:",end="") | ||
if self.calculateCharge() >200: | ||
print("to be return in 4 days") | ||
else: | ||
print("to be return in 7 days") | ||
while True: | ||
name=input("Enter the name: ") | ||
contact=int(input("Enter the contact: ")) | ||
email=input("Enter the email: ") | ||
cloth=input("Enter the type of cloth: ") | ||
brand=bool(input("Branded ? ")) | ||
season=input("Enter the season: ") | ||
obj=LaundryService(name,contact,email,cloth,brand,season,id) | ||
obj.finalDetails() | ||
id=id+1 | ||
z=input("Do you want to continue(Y/N):") | ||
if z=="Y": | ||
continue | ||
elif z =="N": | ||
print("Thanks for visiting!") | ||
break | ||
else: | ||
print("Select valid option") | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
solara == 1.25.0 | ||
solara == 1.32.1 | ||
Flask | ||
gunicorn ==21.2.0 | ||
gunicorn ==22.0.0 | ||
simple-websocket | ||
flask-sock | ||
yfinance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
colorama==0.4.4 | ||
inquirer==2.7.0 | ||
colorama==0.4.6 | ||
inquirer==3.2.4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import datetime | ||
import csv | ||
|
||
def load_tasks(filename='tasks.csv'): | ||
tasks = [] | ||
with open(filename, 'r', newline='') as file: | ||
reader = csv.reader(file) | ||
for row in reader: | ||
tasks.append({'task': row[0], 'deadline': row[1], 'completed': row[2]}) | ||
return tasks | ||
|
||
def save_tasks(tasks, filename='tasks.csv'): | ||
with open(filename, 'w', newline='') as file: | ||
writer = csv.writer(file) | ||
for task in tasks: | ||
writer.writerow([task['task'], task['deadline'], task['completed']]) | ||
|
||
def add_task(task, deadline): | ||
tasks = load_tasks() | ||
tasks.append({'task': task, 'deadline': deadline, 'completed': 'No'}) | ||
save_tasks(tasks) | ||
print("Task added successfully!") | ||
|
||
def show_tasks(): | ||
tasks = load_tasks() | ||
for task in tasks: | ||
print(f"Task: {task['task']}, Deadline: {task['deadline']}, Completed: {task['completed']}") | ||
|
||
# Example usage | ||
add_task('Write daily report', '2024-04-20') | ||
show_tasks() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import datetime | ||
import csv | ||
|
||
def load_tasks(filename='tasks.csv'): | ||
tasks = [] | ||
with open(filename, 'r', newline='') as file: | ||
reader = csv.reader(file) | ||
for row in reader: | ||
tasks.append({'task': row[0], 'deadline': row[1], 'completed': row[2]}) | ||
return tasks | ||
|
||
def save_tasks(tasks, filename='tasks.csv'): | ||
with open(filename, 'w', newline='') as file: | ||
writer = csv.writer(file) | ||
for task in tasks: | ||
writer.writerow([task['task'], task['deadline'], task['completed']]) | ||
|
||
def add_task(task, deadline): | ||
tasks = load_tasks() | ||
tasks.append({'task': task, 'deadline': deadline, 'completed': 'No'}) | ||
save_tasks(tasks) | ||
print("Task added successfully!") | ||
|
||
def show_tasks(): | ||
tasks = load_tasks() | ||
for task in tasks: | ||
print(f"Task: {task['task']}, Deadline: {task['deadline']}, Completed: {task['completed']}") | ||
|
||
# Example usage | ||
add_task('Write daily report', '2024-04-20') | ||
show_tasks() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
aiohttp==3.9.0 | ||
aiohttp==3.9.3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
from inorder_successor import inorder_successor | ||
# The above line imports the inorder_successor function from the inorder_successor.py file | ||
def delete_node(root,val): | ||
""" This function deletes a node with value val from the BST""" | ||
|
||
# search in the left subtree | ||
if root.data < val: | ||
root.right = delete_node(root.right,val) | ||
|
||
# search in the right subtree | ||
elif root.data>val: | ||
root.left=delete_node(root.left,val) | ||
|
||
# node to be deleted is found | ||
else: | ||
# case 1: no child leaf node | ||
if root.left is None and root.right is None: | ||
return None | ||
|
||
# case 2: one child | ||
if root.left is None: | ||
return root.right | ||
|
||
# case 2: one child | ||
elif root.right is None: | ||
return root.left | ||
|
||
# case 3: two children | ||
|
||
# find the inorder successor | ||
IS=inorder_successor(root.right) | ||
root.data=IS.data | ||
root.right=delete_node(root.right,IS.data) | ||
return root | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
def inorder_successor(root): | ||
# This function returns the inorder successor of a node in a BST | ||
|
||
# The inorder successor of a node is the node with the smallest value greater than the value of the node | ||
current=root | ||
|
||
# The inorder successor is the leftmost node in the right subtree | ||
while current.left is not None: | ||
current=current.left | ||
return current |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
def inorder(root): | ||
""" This function performs an inorder traversal of a BST""" | ||
|
||
# The inorder traversal of a BST is the nodes in increasing order | ||
if root is None: | ||
return | ||
|
||
# Traverse the left subtree | ||
inorder(root.left) | ||
|
||
# Print the root node | ||
print(root.data) | ||
|
||
# Traverse the right subtree | ||
inorder(root.right) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from tree_node import Node | ||
def insert(root,val): | ||
|
||
""" This function inserts a node with value val into the BST""" | ||
|
||
# If the tree is empty, create a new node | ||
if root is None: | ||
return Node(val) | ||
|
||
# If the value to be inserted is less than the root value, insert in the left subtree | ||
if val < root.data: | ||
root.left = insert(root.left,val) | ||
|
||
# If the value to be inserted is greater than the root value, insert in the right subtree | ||
else: | ||
root.right = insert(root.right,val) | ||
return root |
Oops, something went wrong.