Breaking News: Grepper is joining You.com. Read the official announcement!
Check it out

Traceback (most recent call last): File "main.py", line 3, in <module> time_left = years - age TypeError: unsupported operand type(s) for -: 'int' an

BRENDAN TOCHUKWU answered on January 10, 2023 Popularity 1/10 Helpfulness 8/10

Contents


More Related Answers

  • unsupported operand type python
  • TypeError: unsupported operand type(s) for ^: 'float' and 'int'
  • Traceback (most recent call last): File "exploit.py", line 63, in <module> choice = menu() File "exploit.py", line 60, in menu return int(choice) ValueError: invalid literal for int() with base 10: ''
  • TypeError Traceback (most recent call last) Input In [37], in <cell line: 1>() ----> 1 type(t) TypeError: 'int' object is not callable

  • Traceback (most recent call last): File "main.py", line 3, in <module> time_left = years - age TypeError: unsupported operand type(s) for -: 'int' an

    1

    You cannot use an operand with incompatible types. For example, if I have the following:

    x  = 4

    y = "6"


    I cannot say print(x + y)

    I can rather decide to convert x to string using the str() function or convert y to and integer using the int() function.

    Popularity 1/10 Helpfulness 8/10 Language python
    Source: Grepper
    Link to this answer
    Share Copy Link
    Contributed on Jan 10 2023
    BRENDAN TOCHUKWU
    0 Answers  Avg Quality 2/10


    X

    Continue with Google

    By continuing, I agree that I have read and agree to Greppers's Terms of Service and Privacy Policy.
    X
    Grepper Account Login Required

    Oops, You will need to install Grepper and log-in to perform this action.