Splitting a string into list items

The split method splits the string into a bunch of strings grouped together in a list.


name = "abdur rehman"
name = name.split(" ")
print(name)

Result:
['abdur', 'rehman']




Comments

Popular posts from this blog

Quotation marks to wrap an element in HTML

The Basic Structure of a Full-Stack Web App

Unlocking Web Design: A Guide to Mastering CSS Layout Modes