Posts by Delfino • 25 points
2 posts
-
2
votes1
answer540
viewsQ: Why does Python consider an empty string ('or "") to be present in a simple variable with characters, but not in a composite one?
When doing basic programs asking for user input, and testing if it is empty with in because of another variable that defines possible inputs, I come across the following: if '' in 'abc': print('not…
-
0
votes1
answer87
viewsQ: Handling characters not saved in variables with F'strings in Python 3
To manipulate unsaved characters in variables with F'strings I do this: print(f'{"String":^20}') I wonder if this is right, or would it be a scam for the fact that I have to define the string inside…