Almost everything in Python is an object. Any string is an object from class 'str'.
You can see all methods of a str object using dir() built-in function.
>>> type("A string or something") <class 'str'>This object may have methods and attributes.
You can see all methods of a str object using dir() built-in function.
>>> dir("A string or something") ['__add__', '__class__', '__contains__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__gt__', '__hash__', '__init__', '__iter__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 'capitalize', 'casefold', 'center', 'count', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'format_map', 'index', 'isalnum', 'isalpha', 'isdecimal', 'isdigit', 'isidentifier', 'islower', 'isnumeric', 'isprintable', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'maketrans', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']
"some string {}".format(variable)
: Here the format method is used to replace the {} with what is inside 'variable'. A callback function can be use in place of 'variable' if it returns something.class Prompter(object)
: https://docs.python.org/3/tutorial/class...nheritance(Mar-29-2017, 03:37 AM)Low_Ki_ Wrote: Another thing... How do I store the username input by the user in a file. Ex:Just like that. But you have to check if the username isn't in the file already. And you have to decide if the letter case matters.