Skip to content

Instantly share code, notes, and snippets.

View Shalabyelectronics's full-sized avatar
💭
Start easy, start small, and keep showing up.

Mohamed Shalaby Shalabyelectronics

💭
Start easy, start small, and keep showing up.
View GitHub Profile
def oct_to_hex(oct):
# write your code here
oct_list = [int(number) for number in str(oct)]
number_pos = len(oct_list) - 1
decimal_list = []
for number in oct_list:
decimal_number = number
for _ in range(number_pos):
decimal_number *= 8
number_pos -= 1
@Shalabyelectronics
Shalabyelectronics / Colorama module
Created March 7, 2022 13:14
شرح تغيير ألوان الخط بإستخدام مكتبة colorama
from colorama import init, Fore, Back, Style
#اذا كنت تريد تشغيل الخطوط من ويندوز فعل هذه الدالة
init()
#الألوان الخطوط الموجودة
FORES = [ Fore.BLACK, Fore.RED, Fore.GREEN, Fore.YELLOW, Fore.BLUE, Fore.MAGENTA, Fore.CYAN, Fore.WHITE ]
# ألوان الخلفيات الموجودة
BACKS = [ Back.BLACK, Back.RED, Back.GREEN, Back.YELLOW, Back.BLUE, Back.MAGENTA, Back.CYAN, Back.WHITE ]
# شدة الألوان او الأضاءة
BRIGHTNESS = [ Style.DIM, Style.NORMAL, Style.BRIGHT ]