Home > Enterprise >  What is wrong in this Python code, can anyone share me the correct code?
What is wrong in this Python code, can anyone share me the correct code?

Time:01-15

When I tried to give the String Values, it was throwing the error.

My Code from Python3:

a,b,c = [eval(x) for x in input("Enter the Values:").split(,)]

print(a,b,c,sep=':')

CodePudding user response:

You are using the eval() on input,

try:

a,b,c = [x for x in input("Enter the Values: ").split(",")]
print(a,b,c,sep=':')
  • Related