Skip to content

Commit d663195

Browse files
committed
finish three beta
1 parent 65d4b10 commit d663195

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

[beta]Caesar Cipher.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import string
2+
def caesar(s, shift):
3+
transDict = {}
4+
alpha = string.ascii_lowercase
5+
alphaTrans = alpha[shift:] + alpha[:shift]
6+
for key,value in zip(string.ascii_lowercase,alphaTrans):
7+
transDict[key] = value
8+
transDict[key.upper()] = value.upper()
9+
10+
return ''.join([transDict[c] if c in transDict else c for c in s])
11+
12+
13+
14+
15+
16+
17+
18+
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
def Xbonacci(signature,n):
2+
digit = -len(signature)
3+
while len(signature) < n:
4+
signature.append(sum(signature[digit:]))
5+
return signature if n >= len(signature) else signature[:n]
6+
7+

[beta]Tribonacci Sequence.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
def tribonacci(signature,n):
2+
while len(signature) < n:
3+
signature.append(sum(signature[-3:]))
4+
return signature if n >= len(signature) else signature[:n]
5+

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy