Advertisement
joespi

Untitled

Feb 17th, 2020
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.85 KB | None | 0 0
  1. def cortarString (status, n):
  2.     ''' Corta un string en "n" piezas. Crea una lista donde cada elemento estará conformado por los "n" caracteres correspondientes. Recordar que i va tomando valores según la funcion range donde range(start, stop=fin del string, step= "n" caracteres) '''
  3.     lista = [status[i:i+n] for i in range(0, len(status), n)]
  4.     return lista
  5.    
  6. status = 'More travel stories from Vietnam Read: 24 first hours in Hanoi, Vietnam with Students Read: drinking Rice shots with Vietnam War Veterans – – – This story was experienced by our writer Kelly, a fearless, adventure-seeking creative here at Hostelgeeks. Find all travel stories with Hostelgeeks. #travel #traveled #traveling #including #include #vietnam #tips #read #new #hostel #hostels #best #experiences #experience #elephant #official #come'
  7.  
  8. print(cortarString(status, 280))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement