0
Why is string formatting used and can it be traversed
2 Answers
+ 1
What do you mean by traversed?
+ 1
String formatting is used to help create readable text output for a positive user experience. There are several ways to traverse text in python as well.
x="So long"
y="thanks for all the"
z="fish"
string=f"{x} and {y} {z}"
print(string)
print('Is "fish" in string:', "fish" in string)
You can also index slice, use find and use regex as well