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

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=’:’)

>Solution :

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=':')

Leave a Reply