Skip to content

Instantly share code, notes, and snippets.

View Hossara's full-sized avatar
😉
Never Give up!

Hossein Araghi Hossara

😉
Never Give up!
View GitHub Profile
@Hossara
Hossara / t1.py
Last active January 7, 2022 14:18
def main():
while(True):
name = str(input("Please Enter Your Name\n> "))
print("\n")
name = name.lower()
temp = []
def gcd(a, b):
while b != 0:
(a, b) = (b, a % b)
return a
def main():
while(True):
n1 = int(input("Please Enter First Number\n> "))
n2 = int(input("Please Enter Secound Number\n> "))
@Hossara
Hossara / IntFloatToBinaryPython.py
Last active January 3, 2023 19:51
Convert int & float to binary in python without using bin function
def trans(x):
if x == 0: return [0]
bit = []
while x:
bit.append(x % 2)
x >>= 1
arr = bit[::-1]
arr = list(map(str, arr))
@Hossara
Hossara / listToCountOfItems.py
Created January 4, 2023 10:38
Program that get size and get list of space separated items and returns count of each items of list.
def solve(list, size):
list = list.split(" ")
count_list = [None] * size
index = 0
for i in list:
count = 0
for j in list:
@Hossara
Hossara / npuzzle.py
Created June 24, 2023 21:29
n-puzzle (Genetic algorithm)
import random
import time
print(
"""
.__ __. .______ __ __ ________ ________ __ _______
| \ | | | _ \ | | | | | / | / | | | ____|
| \| | ______| |_) | | | | | `---/ / `---/ / | | | |__
| . ` | |______| ___/ | | | | / / / / | | | __|
| |\ | | | | `--' | / /----. / /----.| `----.| |____