Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- start = ord('а') # Начален символ "а"
- end = ord('я') # Крайен символ "я"
- # Генериране на кортеж с буквите от "а" до "я"
- azbukata = tuple(chr(code) for code in range(start, end + 1))
- result = azbukata[5]
- result1 = azbukata[5:]
- result2 = azbukata[:6]
- result3 = azbukata[-6:]
- result4 = azbukata[::-1]
- result5 = azbukata[10::-1]
- print("[5]", result)
- print("[5:]", result1)
- print("[:6]", result2)
- print("[-6:]", result3)
- print("[::-1]", result4)
- print("[10::-1]", result5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement