Skip to content

Instantly share code, notes, and snippets.

View sdplamen's full-sized avatar

Plamen Stoilkov sdplamen

View GitHub Profile
@sdplamen
sdplamen / type2mm.py
Created November 25, 2023 07:43
convert type size to mm and vice versa
# Convert mm to type size
def mm_to_points(mm):
# There are 25.4 mm in an inch
# There are 72 points in an inch
points_per_mm = 72 / 25.4
points = mm * points_per_mm
return points
type_size_mm = 10 # Replace with your type size in millimeters
type_size_points = mm_to_points(type_size_mm)
@sdplamen
sdplamen / sqRoot.py
Created November 10, 2023 13:00
calculate square root
def sqr(num):
print(f'√{num} ', end = '')
if num < 0:
print('or error')
else:
print(f'or {num ** 0.5}')
while True:
n = int(input('Enter number for getting square root : '))
sqr(n)