Giving space as the input when code expects charachters


#1

What gets stored in a variable if I give input as space? What does output display on giving print command?


#2

if no validation is in place by the code (you could use .isalpha() for example), then a space should be displayed as output.


#3

Space is a character, space isn’t a special case. If you print a space you print a space.

You could write code that distinguishes between letters from the alphabet and other characters. The “what happens” part is whatever that code says should happen. That’s what code does after all, describe what should happen.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.