Nov-01-2018, 07:21 AM
The task I need to complete is the usage of .sort() and .split()
Students: Peng Ivan Alan Jodi Macy
Class Roll
Alan
Ivan
Jodi
Macy
Peng
How can I achieve this and why am I receiving different errors eg. typeerror and attribute error?
Thanks
## This is the input but the input many vary Peng Ivan Alan Jodi Macy data = input("Students: ") data2 = data.split() data3 = data2.sort() print('Class Roll') print(data3)The expected result is this:
Students: Peng Ivan Alan Jodi Macy
Class Roll
Alan
Ivan
Jodi
Macy
Peng
How can I achieve this and why am I receiving different errors eg. typeerror and attribute error?
Thanks