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, 2019 in Python by Arvind
• 2,980 points
55 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, 2019 by Arvind
• 2,980 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,230 points
69 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, 2019 in Python by Mohammad
• 3,210 points
96 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 Aryya
• 7,340 points
132 views
+1 vote
3 answers

How to run the Python program forever?

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

answered Jun 10, 2019 in Python by brianno
1,040 views
0 votes
1 answer
+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, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 539 views
0 votes
0 answers
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, 2019 in Python by Arvind
• 2,980 points
31 views
0 votes
1 answer

how to sort a list of numbers without using built-in functions like min, max or any other function?

Yes it is possible. You can refer ...READ MORE

answered Jun 27, 2019 in Python by Arvind
• 2,980 points
415 views