How can I print only a few words from a string in Python? It is said that I want to print only the third word (which is a number) and the 10th
, while the duration of the text can be varied every time
pre> mystring = "Thank you."
< / Html> mystring = "your There are 15 new messages and the size is 32000 "parts = mystring.split ('') message_count = int (parts [2]) message_size = int (parts [9])
Comments
Post a Comment