Generate Python code to perform an action based on a given condition.
Condition: If the user input is an integer, print "You have entered an integer"
user_input = input("Enter a number:")
if user_input.isdigit():
   print("You have entered an integer.")