Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- opt = input("Enter Program phase: ")
- def st(n):
- s = "estaklmnbcduvwfghijopqrxyz"
- return s[:n]
- def enter_substring(st,original):
- l = len(st)
- f = 0
- for i in range(len(original)):
- l_count = 0
- if st[0] == original[i]:
- for j in range(len(st)):
- if st[j] == original[i+j]:
- l_count += 1
- if l_count == l:
- print("offset = ",i+1)
- f = 1
- if f == 0:
- print("wrong substring entered!")
- if opt == 1:
- n = input("Enter N: ")
- print(st(n))
- if opt == 2:
- original = st(27)
- st = input("Enter substring: ")
- enter_substring(st,original)
Add Comment
Please, Sign In to add comment