-1

I am making a simple matchmaking program where the program will give the person the name of a boyfriend based on an input (age), but python is not accepting mixing integer variable data go along with string data

age = 40
boyfriend_1 = "John"
age_match = input("Say how old are you: ")
input("Say who would you like to date with: ")
if age_match > age:
    print: "tu novio serĂ¡" +boyfriend_1

Traceback (most recent call last): File "C:/Users/Moderador/PycharmProjects/untitled/my first program.py", line 5, in if age_match > age: TypeError: '>' not supported between instances of 'str' and 'int'

Paul
  • 1

1 Answers1

1

change to:

age_match = int(input("Say how old are you: "))

input results in a string that needs to be converted

Derek Eden
  • 4,403
  • 3
  • 18
  • 31