Here is how to fix it:
n = int(input("type a whole number:"))
Since input() returns a string, you need to convert it to an int first, using int().
More Related Contents:
- How do I print curly-brace characters in a string while using .format?
- Format timedelta to string
- Python TypeError: not enough arguments for format string
- How do I escape curly-brace ({}) characters in a string while using .format (or an f-string)?
- Inserting the same value multiple times when formatting a string
- How to pad a string to a fixed length with spaces [duplicate]
- Why is it string.join(list) instead of list.join(string)?
- How to find all occurrences of a substring?
- Process escape sequences in a string in Python
- Why does substring slicing with index out of range work?
- Calculate cosine similarity given 2 sentence strings
- How to convert string to binary?
- ‘str’ object does not support item assignment
- Split a string at uppercase letters
- How can I print variable and string on same line in Python?
- python replace single backslash with double backslash
- Python float – str – float weirdness
- Easy way of finding decimal places
- formatting long numbers as strings in python
- What is the difference between encode/decode?
- How do I write data into CSV format as string (not file)?
- How to create a numpy array of arbitrary length strings?
- How to write very long string that conforms with PEP8 and prevent E501
- Remove ‘b’ character do in front of a string literal in Python 3 [duplicate]
- Capitalize a string
- Python regex: splitting on pattern match that is an empty string
- How to decode a video (memory file / byte string) and step through it frame by frame in python?
- String-based enum in Python
- How do I convert a list of ascii values to a string in python?
- Finding the position of a word in a string