math-magic-tricks 0.1.0__py3-none-any.whl
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,25 @@
|
|
|
1
|
+
|
|
2
|
+
def birth_year_trick(
|
|
3
|
+
number: int,
|
|
4
|
+
birth_year: int,
|
|
5
|
+
target_year: int = 2026,
|
|
6
|
+
) -> int:
|
|
7
|
+
"""
|
|
8
|
+
Perform a mathematical number trick.
|
|
9
|
+
|
|
10
|
+
Example:
|
|
11
|
+
Choose 14, use birth year 1998, and target year 2026.
|
|
12
|
+
The result is 1428.
|
|
13
|
+
"""
|
|
14
|
+
if not isinstance(number, int) or isinstance(number, bool):
|
|
15
|
+
raise TypeError("number must be an integer")
|
|
16
|
+
|
|
17
|
+
if not isinstance(birth_year, int) or isinstance(birth_year, bool):
|
|
18
|
+
raise TypeError("birth_year must be an integer")
|
|
19
|
+
|
|
20
|
+
if not isinstance(target_year, int) or isinstance(target_year, bool):
|
|
21
|
+
raise TypeError("target_year must be an integer")
|
|
22
|
+
|
|
23
|
+
result = (number * 2 + 5) * 50 + (target_year - 250) - birth_year
|
|
24
|
+
|
|
25
|
+
return result
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: math-magic-tricks
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A Python package for mathematical tricks and puzzles
|
|
5
|
+
License-Expression: MIT
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Python: >=3.9
|
|
8
|
+
Description-Content-Type: text/markdown
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Math Magic Tricks
|
|
12
|
+
|
|
13
|
+
A Python package containing simple mathematical tricks and puzzles.
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install math-magic-tricks
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Example
|
|
22
|
+
|
|
23
|
+
```python
|
|
24
|
+
from math_magic_tricks import birth_year_trick
|
|
25
|
+
|
|
26
|
+
result = birth_year_trick(14, 1998)
|
|
27
|
+
print(result)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Output:
|
|
31
|
+
|
|
32
|
+
```text
|
|
33
|
+
1428
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## How it works
|
|
37
|
+
|
|
38
|
+
The trick calculates:
|
|
39
|
+
|
|
40
|
+
(number × 2 + 5) × 50 + (target year − 250) − birth year
|
|
41
|
+
|
|
42
|
+
With the default target year of 2026, this simplifies to:
|
|
43
|
+
|
|
44
|
+
100 × number + 2026 − birth year
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
MIT
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
math_magic_tricks/__init__.py,sha256=1oc1Ndo6ZtL8whMMr37Rcu-RVVULgLkX_3nGD64XStc,74
|
|
2
|
+
math_magic_tricks/tricks.py,sha256=vi9qoZHiFw4-2yqoSThjqBWEKSr1PeToURe74V5717c,748
|
|
3
|
+
math_magic_tricks-0.1.0.dist-info/METADATA,sha256=1Vhw_-QdIuzwd5F0dp4MDQKPZzYRd8fdrBa44kOqKFs,752
|
|
4
|
+
math_magic_tricks-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
|
|
5
|
+
math_magic_tricks-0.1.0.dist-info/licenses/LICENSE,sha256=bSpTeJXJOki4oeEuZxz1-sd4s-YJGRr4pfczH2Y8nZg,836
|
|
6
|
+
math_magic_tricks-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
MIT License
|
|
3
|
+
|
|
4
|
+
Copyright (c) 2026 Musaib Manzoor Shah
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|