Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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(,)]

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading