0

I write a program in python as following:

def describe_pet(animal_type, pet_name):
    print("\n I have a" + animal_type + ".")
    print("My" + animal_type + "'s name is " + pet_name.title() + ".")

It runs smoothly in sublime with ctrl+B, but I don't know how to input variable "animal type" or "pet_name" in sublime

89085731
  • 141
  • 5
  • You have to [call your function](https://stackoverflow.com/questions/19130958/what-does-it-mean-to-call-a-function-in-python). – Selcuk Jan 04 '21 at 03:04

1 Answers1

1

Sublime text currently doesn't allow user input. See this forum post. You can develop a custom build to add this functionality as seen here, or you can install packages, which may make this possible. The last solution would be to use another IDE, such as VS Code.

DapperDuck
  • 2,728
  • 1
  • 9
  • 21
  • This isn't true - see the duplicate. You can create custom build systems in Sublime that enable input, without needing SublimeREPL or other plugins. – MattDMo Jan 04 '21 at 21:04
  • @MattDMo Thanks for the comment! I edited my question to include custom builds as a solution and linked your answer. – DapperDuck Jan 04 '21 at 21:43