I am trying to get two variables from one input as follows:
x, y = input().split()
print(x, y)
But I want the variable to ybe optional, so if the user enters only x, he will print only that value. I get a ValueErrorif I just inserted the argument x.
Does anyone know how to do this?
source
share