Skip to content

Commit

Permalink
Add new python files (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
DearSmc authored Oct 30, 2022
1 parent 9f76d8f commit 66749fb
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions Python/DearSmc.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
import random
def initCode(word):
makePowerList = ["coffee", "beer", "shabu"]
arr = []
if word in makePowerList:
arr = list(set(word))
str = "".join(set(word)).replace("f","d")
arr = list(str)
while str != "code":
random.shuffle(arr)
str = "".join(arr);
print(str)

else:
print("I'm so tired that not enough")

startWord = "coffee"
initCode(startWord)
text = "Coffee"
leastAlphabet = ""
result = ""

for i in range(len(text)):
if leastAlphabet == text[i]:
if text[i] == "f":
result = result[:-1]
result += "d"
if text[i] == "e":
continue
else:
result += text[i]
leastAlphabet = text[i]


print(result)

0 comments on commit 66749fb

Please sign in to comment.