how to check the syntax of python program without running the program?

0 votes
I am new to Python and still learning it. Is it possible to check the syntax of a python program without running it? If yes how can I do it?
Jun 27 in Python by Arvind
• 2,960 points
45 views

1 answer to this question.

0 votes

Yes, it is possible to check the syntax of a program without executing it. You can do it by simply compiling the program.

python -m py_compile program_name.py
answered Jun 27 by Arvind
• 2,960 points

Related Questions In Python

0 votes
1 answer

How to check the version of Python?

you can check the version of python ...READ MORE

answered Sep 25, 2018 in Python by SDeb
• 13,210 points
65 views
0 votes
1 answer

how do I check the length of an array in a python program?

lets say we have a list mylist = ...READ MORE

answered Mar 12 in Python by Mohammad
• 3,170 points
76 views
0 votes
1 answer

How to get the size of a string in Python?

If you are talking about the length ...READ MORE

answered Jun 4, 2018 in Python by ariaholic
• 7,340 points
115 views
+1 vote
3 answers

How to run the Python program forever?

you can also do the old fashioned ...READ MORE

answered Jun 10 in Python by brianno
894 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 424 views
0 votes
1 answer

How to find the type of variable in Python?

i=277 type(i) # int i = 2.56j type(i) # complex i ...READ MORE

answered Jul 16 in Python by Arvind
• 2,960 points
25 views
0 votes
1 answer