Advertisement
lubattillah

indexes and slices

May 12th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. phrase="ithinkyoushouldbeginPythonProgramming"
  2. text1=phrase[0]
  3. text2=phrase[1:6]
  4. text3=phrase[-31:-28]
  5. text4=phrase[-28:-22]
  6. text5=phrase[15:20]
  7. text6=phrase[20:26]
  8. text7=phrase[26:]
  9. print(text1+" "+text2+" "+text3+" "+text4+" "+text5+" "+text6+" "+text7)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement