Nov-14-2016, 09:26 PM
You also do not need to specify 'str' in conjunction with the input statement, as 'input' by default, will create a string.
so this:
so this:
sentence = str(input("Enter a sentence without punctuation: ")).lower()is the same as:
sentence = input("Enter a sentence without punctuation: ").lower()You only need to prepend when you want something other than a string. For example, to expect an integer from the user:
answer = int(input("Enter an integer: ")
If it ain't broke, I just haven't gotten to it yet.
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition
OS: Windows 10, openSuse 42.3, freeBSD 11, Raspian "Stretch"
Python 3.6.5, IDE: PyCharm 2018 Community Edition