Nov-29-2020, 11:50 AM
Hi everyone, I am trying to write a program as a python beginner.
This function scans the given text. Whenever I come across the symbols “@, &, % or $”, I have to take the text until that point and print it as a single line. Also, I have to skip the symbol, start the next line from the letter right after the symbol and print it until I come across another symbol.
I hope I told it well.
This function scans the given text. Whenever I come across the symbols “@, &, % or $”, I have to take the text until that point and print it as a single line. Also, I have to skip the symbol, start the next line from the letter right after the symbol and print it until I come across another symbol.
I hope I told it well.
symbols= "@, &, %, $”" for symbol in text: if text.startswith (symbols): print (text)I know it's not correct but that was all I could think. Any help is appreciated.