Advertisement
Nenogzar

Untitled

Oct 18th, 2023
982
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.54 KB | None | 0 0
  1. start = ord('а')  # Начален символ "а"
  2. end = ord('я')   # Крайен символ "я"
  3.  
  4. # Генериране на кортеж с буквите от "а" до "я"
  5. azbukata = tuple(chr(code) for code in range(start, end + 1))
  6.  
  7. result = azbukata[5]
  8. result1 = azbukata[5:]
  9. result2 = azbukata[:6]
  10. result3 = azbukata[-6:]
  11. result4 = azbukata[::-1]
  12. result5 = azbukata[10::-1]
  13.  
  14. print("[5]", result)
  15. print("[5:]", result1)
  16. print("[:6]", result2)
  17. print("[-6:]", result3)
  18. print("[::-1]", result4)
  19. print("[10::-1]", result5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement