numbrillo 0.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: numbrillo
3
+ Version: 0.0.0
@@ -0,0 +1,13 @@
1
+ # numbrilo
2
+
3
+ A small calculator library with random numbers.
4
+
5
+ ## Usage
6
+
7
+ import numbrilo
8
+
9
+ numbrilo.module_plus()
10
+ numbrilo.module_minus(5, 3)
11
+ numbrilo.module_multiply(4, 2)
12
+ numbrilo.module_divide(10, 2)
13
+
@@ -0,0 +1,66 @@
1
+ import random
2
+
3
+
4
+ def module_plus(x=None, y=None):
5
+ if x is None and y is None:
6
+ x = random.randint(1, 10)
7
+ y = random.randint(1, 10)
8
+
9
+ elif x is None or y is None:
10
+ raise TypeError("Нужно указать оба числа")
11
+
12
+ z = x + y
13
+
14
+ print(f"{x} + {y} =\n{z}")
15
+
16
+ return z
17
+
18
+
19
+ def module_minus(x=None, y=None):
20
+ if x is None and y is None:
21
+ x = random.randint(12, 20)
22
+ y = random.randint(1, 10)
23
+
24
+ elif x is None or y is None:
25
+ raise TypeError("Нужно указать оба числа")
26
+
27
+ z = x - y
28
+
29
+ print(f"{x} - {y} =\n{z}")
30
+
31
+ return z
32
+
33
+
34
+ def module_multiply(x=None, y=None):
35
+ if x is None and y is None:
36
+ x = random.randint(1, 10)
37
+ y = random.randint(1, 10)
38
+
39
+ elif x is None or y is None:
40
+ raise TypeError("Нужно указать оба числа")
41
+
42
+ z = x * y
43
+
44
+ print(f"{x} × {y} =\n{z}")
45
+
46
+ return z
47
+
48
+
49
+ def module_divide(x=None, y=None):
50
+ if x is None and y is None:
51
+ y = random.randint(1, 10)
52
+ z = random.randint(1, 10)
53
+ x = y * z
54
+
55
+ elif x is None or y is None:
56
+ raise TypeError("Нужно указать оба числа")
57
+
58
+ if y == 0:
59
+ raise ZeroDivisionError("Нельзя делить на ноль")
60
+
61
+ z = x / y
62
+
63
+ print(f"{x} ÷ {y} =\n{z}")
64
+
65
+ return z
66
+
@@ -0,0 +1,3 @@
1
+ Metadata-Version: 2.4
2
+ Name: numbrillo
3
+ Version: 0.0.0
@@ -0,0 +1,7 @@
1
+ README.md
2
+ pyproject.toml
3
+ numbrillo/__init__.py
4
+ numbrillo.egg-info/PKG-INFO
5
+ numbrillo.egg-info/SOURCES.txt
6
+ numbrillo.egg-info/dependency_links.txt
7
+ numbrillo.egg-info/top_level.txt
@@ -0,0 +1 @@
1
+ numbrillo
File without changes
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+