nlttk 0.0.7__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.
- nlttk-0.0.7/PKG-INFO +9 -0
- nlttk-0.0.7/README.md +1 -0
- nlttk-0.0.7/pyproject.toml +17 -0
- nlttk-0.0.7/setup.cfg +4 -0
- nlttk-0.0.7/src/nlttk/__init__.py +10 -0
- nlttk-0.0.7/src/nlttk/prog1.py +8 -0
- nlttk-0.0.7/src/nlttk/prog10.py +10 -0
- nlttk-0.0.7/src/nlttk/prog2.py +10 -0
- nlttk-0.0.7/src/nlttk/prog3.py +9 -0
- nlttk-0.0.7/src/nlttk/prog4.py +35 -0
- nlttk-0.0.7/src/nlttk/prog5.py +28 -0
- nlttk-0.0.7/src/nlttk/prog6.py +38 -0
- nlttk-0.0.7/src/nlttk/prog7.py +22 -0
- nlttk-0.0.7/src/nlttk/prog8.py +34 -0
- nlttk-0.0.7/src/nlttk/prog9.py +18 -0
- nlttk-0.0.7/src/nlttk.egg-info/PKG-INFO +9 -0
- nlttk-0.0.7/src/nlttk.egg-info/SOURCES.txt +17 -0
- nlttk-0.0.7/src/nlttk.egg-info/dependency_links.txt +1 -0
- nlttk-0.0.7/src/nlttk.egg-info/top_level.txt +1 -0
nlttk-0.0.7/PKG-INFO
ADDED
nlttk-0.0.7/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# nlttk
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "nlttk"
|
|
7
|
+
version = "0.0.7"
|
|
8
|
+
description = "My Python package"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "MangoJuice" }
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
[tool.setuptools.packages.find]
|
|
17
|
+
where = ["src"]
|
nlttk-0.0.7/setup.cfg
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
from .prog1 import display1
|
|
2
|
+
from .prog2 import display2
|
|
3
|
+
from .prog3 import display3
|
|
4
|
+
from .prog4 import display4
|
|
5
|
+
from .prog5 import display5
|
|
6
|
+
from .prog6 import display6
|
|
7
|
+
from .prog7 import display7
|
|
8
|
+
from .prog8 import display8
|
|
9
|
+
from .prog9 import display9
|
|
10
|
+
from .prog10 import display10
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
def display2():
|
|
2
|
+
code = '''def cel_to_ft(celsius):
|
|
3
|
+
return(celsius*1.8)+32
|
|
4
|
+
celsius=float(input("Enter temp in C:"))
|
|
5
|
+
farenheit=cel_to_ft(celsius)
|
|
6
|
+
if farenheit<32:
|
|
7
|
+
print(f"{celsius}Celsius equivalent to {farenheit:.2f} and Farenheit is below freezing.")
|
|
8
|
+
else:
|
|
9
|
+
print(f"{celsius}Celsius equivalent to {farenheit:.2f}and Farenheit is not below freezing.")'''
|
|
10
|
+
print(code)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
def display4():
|
|
2
|
+
code = '''class Person:
|
|
3
|
+
def __init__(self, name, age, gender):
|
|
4
|
+
self.name = name
|
|
5
|
+
self.age = age
|
|
6
|
+
self.gender = gender
|
|
7
|
+
self.children = []
|
|
8
|
+
|
|
9
|
+
def add_child(self, child):
|
|
10
|
+
self.children.append(child)
|
|
11
|
+
print(f"{child.name} is the child of {self.name}")
|
|
12
|
+
|
|
13
|
+
def display_children(self):
|
|
14
|
+
if self.children:
|
|
15
|
+
print(f"{self.name}'s Children:")
|
|
16
|
+
for child in self.children:
|
|
17
|
+
print(child.name)
|
|
18
|
+
else:
|
|
19
|
+
print(f"{self.name} has no children.")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
father = Person("John", 40, "Male")
|
|
23
|
+
mother = Person("Jane", 38, "Female")
|
|
24
|
+
son = Person("Alex", 12, "Male")
|
|
25
|
+
daughter = Person("Emma", 8, "Female")
|
|
26
|
+
|
|
27
|
+
father.add_child(son)
|
|
28
|
+
mother.add_child(daughter)
|
|
29
|
+
|
|
30
|
+
mother.add_child(son)
|
|
31
|
+
mother.add_child(daughter)
|
|
32
|
+
|
|
33
|
+
father.display_children()
|
|
34
|
+
mother.display_children()'''
|
|
35
|
+
print(code)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
def display5():
|
|
2
|
+
code = '''def minEatingSpeed(piles, H):
|
|
3
|
+
def can_eat_all_bananas(S):
|
|
4
|
+
hours = 0
|
|
5
|
+
for pile in piles:
|
|
6
|
+
hours += pile // S
|
|
7
|
+
if pile % S != 0:
|
|
8
|
+
hours += 1
|
|
9
|
+
if hours > H:
|
|
10
|
+
return False
|
|
11
|
+
return True
|
|
12
|
+
|
|
13
|
+
left, right = 1, max(piles)
|
|
14
|
+
|
|
15
|
+
while left < right:
|
|
16
|
+
mid = (left + right) // 2
|
|
17
|
+
if can_eat_all_bananas(mid):
|
|
18
|
+
right = mid
|
|
19
|
+
else:
|
|
20
|
+
left = mid + 1
|
|
21
|
+
|
|
22
|
+
return left
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
piles = [3, 6, 7, 11]
|
|
26
|
+
H = 8
|
|
27
|
+
print(minEatingSpeed(piles, H))'''
|
|
28
|
+
print(code)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
def display6():
|
|
2
|
+
code = '''N = 4
|
|
3
|
+
ld = [0] * (2 * N - 1)
|
|
4
|
+
rd = [0] * (2 * N - 1)
|
|
5
|
+
cl = [0] * N
|
|
6
|
+
|
|
7
|
+
def printSolution(board):
|
|
8
|
+
for i in range(N):
|
|
9
|
+
for j in range(N):
|
|
10
|
+
print("Q" if board[i][j] == 1 else ".", end=" ")
|
|
11
|
+
print()
|
|
12
|
+
def solveNQUtil(board, col):
|
|
13
|
+
if col >= N:
|
|
14
|
+
return True
|
|
15
|
+
for i in range(N):
|
|
16
|
+
if ld[i - col + N - 1] == 0 and rd[i + col] == 0 and cl[i] == 0:
|
|
17
|
+
board[i][col] = 1
|
|
18
|
+
ld[i - col + N - 1] = rd[i + col] = cl[i] = 1
|
|
19
|
+
|
|
20
|
+
if solveNQUtil(board, col + 1):
|
|
21
|
+
return True
|
|
22
|
+
|
|
23
|
+
board[i][col] = 0
|
|
24
|
+
ld[i - col + N - 1] = rd[i + col] = cl[i] = 0
|
|
25
|
+
return False
|
|
26
|
+
def solveNQ():
|
|
27
|
+
board = [[0 for _ in range(N)] for _ in range(N)]
|
|
28
|
+
|
|
29
|
+
if not solveNQUtil(board, 0):
|
|
30
|
+
print("Solution doesn't exist")
|
|
31
|
+
return False
|
|
32
|
+
|
|
33
|
+
printSolution(board)
|
|
34
|
+
return True
|
|
35
|
+
|
|
36
|
+
if __name__ == "__main__":
|
|
37
|
+
solveNQ()'''
|
|
38
|
+
print(code)
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
def display7():
|
|
2
|
+
code = '''a={10,20,30,40,50}
|
|
3
|
+
b={30,40,50,60,70}
|
|
4
|
+
c={10,20}
|
|
5
|
+
d={80,90}
|
|
6
|
+
print("set a:",a)
|
|
7
|
+
print("set b:",b)
|
|
8
|
+
print("set c:",c)
|
|
9
|
+
print("set d:",d)
|
|
10
|
+
print("\\n 1.union:",a|b)
|
|
11
|
+
print("\\n 2.intersection:",a&b)
|
|
12
|
+
print("\\n 3.difference:",a-b)
|
|
13
|
+
print("\\n 4.difference:",b-a)
|
|
14
|
+
print("\\n 5.symmetric difference:",a^b)
|
|
15
|
+
print("Is c subset of a:",c.issubset(a))
|
|
16
|
+
print("Is a superset of c:",a.issuperset(c))
|
|
17
|
+
print("Are a and b disjoint:",a.isdisjoint(d))
|
|
18
|
+
a.add(100)
|
|
19
|
+
print("\\n after adding 100 to a:",a)
|
|
20
|
+
a.remove(10)
|
|
21
|
+
print("\\n after removing 10 from a:",a)'''
|
|
22
|
+
print(code)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
def display8():
|
|
2
|
+
code = '''class Client:
|
|
3
|
+
def __init__(self, name, address, phone):
|
|
4
|
+
self.name = name
|
|
5
|
+
self.address = address
|
|
6
|
+
self.phone = phone
|
|
7
|
+
|
|
8
|
+
def place_order(self, order):
|
|
9
|
+
print(f"Order placed by {self.name}: {order}")
|
|
10
|
+
|
|
11
|
+
class Worker:
|
|
12
|
+
def __init__(self, name, id):
|
|
13
|
+
self.name = name
|
|
14
|
+
self.id = id
|
|
15
|
+
|
|
16
|
+
def take_order(self, client, order):
|
|
17
|
+
print(f"Order taken by {self.name} (ID: {self.id}) from {client.name}: {order}")
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class FoodItem:
|
|
21
|
+
def __init__(self, name, price):
|
|
22
|
+
self.name = name
|
|
23
|
+
self.price = price
|
|
24
|
+
|
|
25
|
+
def display(self):
|
|
26
|
+
print(f"{self.name}: ${self.price}")
|
|
27
|
+
|
|
28
|
+
client1 = Client("John Doe", "123 Main St", "123-456-7890")
|
|
29
|
+
worker1 = Worker("Alice", "WORK1")
|
|
30
|
+
food1 = FoodItem("Pizza", 10.99)
|
|
31
|
+
client1.place_order("2 pizzas and 1 coke")
|
|
32
|
+
worker1.take_order(client1, "2 pizzas and 1 coke")
|
|
33
|
+
food1.display()'''
|
|
34
|
+
print(code)
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
def display9():
|
|
2
|
+
code = '''punctuation = "!@#$%^&*()_[]{}\\\\?/.,<>"
|
|
3
|
+
|
|
4
|
+
text = input("Enter the string: ")
|
|
5
|
+
no_punc = ""
|
|
6
|
+
|
|
7
|
+
for char in text:
|
|
8
|
+
if char not in punctuation:
|
|
9
|
+
no_punc = no_punc + char
|
|
10
|
+
|
|
11
|
+
print("String without punctuation:", no_punc)
|
|
12
|
+
|
|
13
|
+
str=input("enter a string:")
|
|
14
|
+
words=str.split()
|
|
15
|
+
words.sort()
|
|
16
|
+
for word in words:
|
|
17
|
+
print(word)'''
|
|
18
|
+
print(code)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/nlttk/__init__.py
|
|
4
|
+
src/nlttk/prog1.py
|
|
5
|
+
src/nlttk/prog10.py
|
|
6
|
+
src/nlttk/prog2.py
|
|
7
|
+
src/nlttk/prog3.py
|
|
8
|
+
src/nlttk/prog4.py
|
|
9
|
+
src/nlttk/prog5.py
|
|
10
|
+
src/nlttk/prog6.py
|
|
11
|
+
src/nlttk/prog7.py
|
|
12
|
+
src/nlttk/prog8.py
|
|
13
|
+
src/nlttk/prog9.py
|
|
14
|
+
src/nlttk.egg-info/PKG-INFO
|
|
15
|
+
src/nlttk.egg-info/SOURCES.txt
|
|
16
|
+
src/nlttk.egg-info/dependency_links.txt
|
|
17
|
+
src/nlttk.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nlttk
|