Skip to content

Instantly share code, notes, and snippets.

View celyes's full-sized avatar
🎯
Focusing

Ilyes Chouia celyes

🎯
Focusing
View GitHub Profile
@celyes
celyes / Recursion.py
Created March 20, 2018 21:33
a simple code to illustrate the recursion
def recursive(n):
if n == 0:
return 0
elif n == 1:
return 1
else :
return n * recursive(n-1)
print(recursive(5))
@celyes
celyes / test.py
Created March 15, 2018 12:51
Reverse string in python
def reverseStr(s):
print(s[::-1])
x = input("Write a word to reverse : ")
reverseStr(x.lower())
@celyes
celyes / Odd_Event_Characters.py
Created March 5, 2018 15:10
Micro Code Djelfa 2018
#Prints even characters
def printEven(text):
result = ""
for i in range(len(text)):
if i%2==0:
result = result + text[i]
return result
#Prints Odd characters
def printOdd(text):
def remove_duplicate(text):
# container to receive unique values from text
allowed_string = []
# #
# this loop adds character to the allowed_string array
# only if it is unique
# #