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

Print String in Python

I tried running this basic python script to print something, and it doesn’t seem to be executing properly.

name = "Tyler";
print{name};

I am getting this error:

File "C:\Users\tyler\main.py", line 2
    print{name};
    ^^^^^^^^^^^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?

I tried changing line 2 to:

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(...)

but it prints out
Ellipsis, not my name.

>Solution :

You don’t need semicolons in Python
The issue was the use of curly braces. Call your variable name with print() like this:

name = "Tyler"
print(name)
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