python - What is the difference between a string and non-string? -
i'm beginning learn basics of python. had learned str() turns non-strings strings - example: str(2) change 2 "2". raised question - string , difference have non-string? i've googled not find question directly answered , general explanations don't quite make clear me.
"that raised question - string , difference have non-string?"
it sounds python first language. being said, conceptual sake, string text, , 'non-string' number. see why not quite true program more, understanding difference between string , 'non-string' suffice. can math 'non-strings'. "2" string, 2 'non-string'. adding strings not same arithmetic addition. "2" + "2" results in string "22" (this operation called concatenation ), 2 + 2 results in 'non-string' a.k.a. number (not string) 4, because addition arithmetic addition.
Comments
Post a Comment