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
• 1,530 points
20 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
• 1,530 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
• 12,360 points
36 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
• 1,500 points
27 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,320 points
58 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
436 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 130 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 4 days ago in Python by Arvind
• 1,530 points
9 views
0 votes
1 answer