Member-only story
10 Important Python Questions You Should Know
Check Your Knowledge By Solving These Questions
There Are Over 8 Million+ Python Developers Present Around the world. Everyday Thousands of New Learners Added To The Community of Python. The Harsh Fact is Only 10–20% are able to become a good developer and get a good job. The reason is they aren’t able to solve some of the advanced interview questions. In this blog, I am going to share with you 10 Important Python Questions You Should Know.
1. What is the difference between .py and .pyc files?
▶ The .py file contains the source code of the program. On the other hand .pyc files contain the compiled byte of your program.
Python Compiles the .py file and saved it into a .pyc file. Then It is executed by the Python Virtual Machine.
Before executing the main source code python looks for a compiled version of it(.pyc file) if python finds one then it will execute it with the help of a virtual machine. if not then it will look for a .py file compiles it and then execute the .py file. Basically, .pyc
files save the compilation time, By Executing the already compiled code again.