Quick Sort in Python
@Dagmawi_Babi
def sort(array):#Telegram #Code #QuickSort #Python
#Sort the array by using quicksort
less = []
equal = []
greater = []
if len(array) > 1:
pivot = array[0]
for x in array:
if x < pivot:
less.append(x)
elif x == pivot:
equal.append(x)
elif x > pivot:
greater.append(x)
return sort(less)+equal+sort(greater)
else:
return array
@Dagmawi_Babi
Python program to display the Fibonacci sequence
#Telegram #Code #Fibonacci #Python
@Dagmawi_Babi
# Recursive Fibonacci
def recur_fibo(n):
if n <= 1:
return n
else:
return(recur_fibo(n-1) + recur_fibo(n-2))
nterms = 10
# check if the number of terms is valid
if nterms <= 0:
print("Plese enter a positive integer")
else:
print("Fibonacci sequence:")
for i in range(nterms):
print(recur_fibo(i))
#Telegram #Code #Fibonacci #Python
@Dagmawi_Babi
Anyways Fast HTML was released last night.
• FastHT.ML
If you're a pythonista this should make you happy cause now you can build modern web applications in pure Python and deploy basically anywhere.
Here's a tutorial
• youtu.be/Auqrm7WFc0I?si=xS-k-XfbXi3w_njT
Or docs
• docs.fastht.ml
What's impressive is that FastHTML itself is just 1k lines of code and compliments the design philosophy of FastAPI.
#FastHTML #Python
@Dagmawi_Babi
• FastHT.ML
If you're a pythonista this should make you happy cause now you can build modern web applications in pure Python and deploy basically anywhere.
Here's a tutorial
• youtu.be/Auqrm7WFc0I?si=xS-k-XfbXi3w_njT
Or docs
• docs.fastht.ml
What's impressive is that FastHTML itself is just 1k lines of code and compliments the design philosophy of FastAPI.
#FastHTML #Python
@Dagmawi_Babi