Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a5d2d5f

Browse files
committed
script updated
1 parent 59285fc commit a5d2d5f

32 files changed

+353
-22
lines changed

__pycache__/test.cpython-311.pyc

161 Bytes
Binary file not shown.
1.35 KB
Binary file not shown.

book.xml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<library>
2+
<book id="1">
3+
<title>Python for Data Science</title>
4+
<author>
5+
<first_name>John</first_name>
6+
<last_name>Doe</last_name>
7+
</author>
8+
<genre>Data Science</genre>
9+
<price currency="USD">29.99</price>
10+
<publication_year>2020</publication_year>
11+
<publisher>Big Data Publishing</publisher>
12+
</book>
13+
<book id="2">
14+
<title>Machine Learning Basics</title>
15+
<author>
16+
<first_name>Jane</first_name>
17+
<last_name>Smith</last_name>
18+
</author>
19+
<genre>Machine Learning</genre>
20+
<price currency="USD">39.99</price>
21+
<publication_year>2019</publication_year>
22+
<publisher>AI Press</publisher>
23+
</book>
24+
</library>

clock.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Digital Clock with Turtle
2+
import turtle
3+
import time
4+
5+
# set up the screen
6+
wn = turtle.Screen()
7+
wn.bgcolor('black')
8+
wn.setup(width=800,height=600)
9+
10+
# create a turtle for drawing
11+
t = turtle.Turtle()
12+
t.hideturtle()
13+
t.penup()
14+
t.color('green')
15+
t.speed(0)
16+
t.pensize(5)
17+
18+
# function to draw the current time
19+
def draw_time(some_turtle,
20+
time_string):
21+
some_turtle.clear()
22+
some_turtle.write(
23+
time_string,
24+
align='center',
25+
font=('Arial',60,'normal')
26+
)
27+
# continuously update the clock
28+
while True:
29+
c_time = time.strftime(
30+
"%H:%M:%S"
31+
)
32+
draw_time(t, c_time)
33+
time.sleep(1)

coolmath.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from coolmath1 import add
2+
res = add(2, 3)
3+
print(res)

coolmath1/README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,20 @@ A simple Python library for basic mathematical operations.
77
You can install this library using pip:
88

99
```bash
10-
pip install coolmath
10+
pip install coolmath1
11+
```
12+
# Usage
1113

12-
python setup.py sdist bdist_wheel
13-
you can upload to the packing library index PyPI
14+
```bash
15+
from coolmath1 import add, subtract, multiply, divide
1416

15-
to upload it
16-
you need to install
17-
pip install twine
17+
result_add = add(5, 3)
18+
result_subtract = subtract(10, 4)
19+
result_multiply = multiply(6, 7)
20+
result_divide = divide(8, 2)
1821

19-
pip install coolmath
22+
print(f"Addition: {result_add}")
23+
print(f"Subtraction: {result_subtract}")
24+
print(f"Multiplication: {result_multiply}")
25+
print(f"Division: {result_divide}")
2026

21-
from coolmath
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Contents of coolmath/coolmath1/__init__.py:
2+
3+
from .math_operations import add, subtract, multiply, divide
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Contents of coolmath/coolmath/math_operations.py:
2+
3+
def add(a, b):
4+
return a + b
5+
6+
def subtract(a, b):
7+
return a - b
8+
9+
def multiply(a, b):
10+
return a * b
11+
12+
def divide(a, b):
13+
if b == 0:
14+
raise ValueError("Cannot divide by zero")
15+
return a / b
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Contents of coolmath/coolmath/__init__.py:
1+
# Contents of coolmath/coolmath1/__init__.py:
22

33
from .math_operations import add, subtract, multiply, divide

coolmath1/coolmath.egg-info/PKG-INFO

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Metadata-Version: 2.1
22
Name: coolmath
3-
Version: 0.1
3+
Version: 0.4
44
Summary: A simple math library
55
Home-page: https://github.com/epythonlab/coolmath
66
Author: Asibeh Tenager
7-
Author-email: epythonlab@epythonlab.com
7+
Author-email: asibeh.tenager@gmail.com
88
Classifier: Development Status :: 3 - Alpha
99
Classifier: Intended Audience :: Developers
1010
Classifier: License :: OSI Approved :: MIT License
@@ -25,3 +25,19 @@ You can install this library using pip:
2525

2626
```bash
2727
pip install coolmath
28+
```
29+
# Usage
30+
31+
```bash
32+
from coolmath import add, subtract, multiply, divide
33+
34+
result_add = add(5, 3)
35+
result_subtract = subtract(10, 4)
36+
result_multiply = multiply(6, 7)
37+
result_divide = divide(8, 2)
38+
39+
print(f"Addition: {result_add}")
40+
print(f"Subtraction: {result_subtract}")
41+
print(f"Multiplication: {result_multiply}")
42+
print(f"Division: {result_divide}")
43+

0 commit comments

Comments
 (0)