It is very useful tool for differents manipulating on five.
To use this library just import it in that way:
from five import Five
Next you need create an instance of class Five
:
my_five = Five()
- Library helps avoid magic
5
number for calculations:
my_five + 3 #8
my_five ** 2 #25
2 ** my_five #32
my_five << 3 #40
if my_five < 6:
print('It works!') # 'It works will be displayed'
- Library can be useful for translating
five
in many languages:
print(my_five.say_five_in_language('Russian')) # пять
print(my_five.say_five_in_language('Polish')) # pięć
- You can also check for
five
in different digits:
my_five.print_five_in_digit_type('European') # 5
my_five.print_five_in_digit_type('Arabic') # ٥
my_five.print_five_in_digit_type('Arabic-west') # ۵
- You can also check for properties of
five
:
my_five.is_complex() # False
my_five.is_rational() # True
- Or even represent
5
by any sort of operation:
my_five.as_sum() # 3+2
my_five.as_fraction() # 10/2
- Function
draw_five
can draw five:
____
|
|--\
|
---/
- It also can repeat everyting
5
times!
my_five.say_five_times('😹') # it will print: 😹😹😹😹😹
my_five.say_five_times('vodka') # it will print: vodkavodkavodkavodkavodka