0

I'm very new to Python and I'm trying to set a value in the input() text. This value comes as an argument (sys.argv[1]) and I want this value to be able to be modified. An example of the input:

myvar = int(input("Next input is modifiable: " , sys.argv[1]))

So that the output is something like this:

Next input is modifiable: 123456

Being 123456 something I can change. I'm not sure if this is able to do but I've been through some sites and didn't find anything similar.

Thanks in advance!

myvar= int(input("Next input is modifiable {}" , sys.argv[1]))

  • 2
    Does this answer your question? [Show default value for editing on Python input possible?](https://stackoverflow.com/questions/2533120/show-default-value-for-editing-on-python-input-possible) – buran Nov 02 '22 at 12:34

1 Answers1

0

Could this work?

myvar = int(input("Next input is modifiable: " , sys.argv[1]))
if myvar == "":
    myvar = sys.argv[1]