Im given a question where I have to ask the user for his/her address then split to a new line where there is a comma in the address. After doing that align the whole thing to right, ive been trying to figure this out but I can only do one of the 2, split or align. This is my code:
def Q5():
str = input("Enter your address (separate lines with comma) :\n")
for c in str:
print(c, end="")
if(c == ","):
print("")
#print (str.rjust(50))
Q5()
Please help me fix this. Thanks in advance
str.split()method. BTW, please don't usestras a variable name as that shadows the built-instrtype.