store string in a variable, say:
strs="""Justin$Calculus$90$Java$85$Python88$
Taylor$Calculus$73$Java$95$Python86$
Drew$Calculus$80$Java$75$Python94$
"""
loop over strs.split()
using a for loop , i.e for line in strs.split()
(using strs.split()
will return a list containing all lines, splitted at whitespace)
now for each line use line.rstrip("$").split('$')
, it'll return something like this for the first line:
['Justin', 'Calculus', '90', 'Java', '85', 'Python88']
rstrip("$")
will remove the rightmost $
from the line