- How does Python execution start?
Answer: Python execution starts from the first line of the script and runs line by line from top to bottom. When we run a file using the command: python filename.py the Python interpreter: Reads the code Converts it into bytecode Executes each line sequentially If the script contains functions, they are executed only when called.
- Difference between Compiled and Interpreted Languages
Answer:
- What is the role of an IDE?
Answer: An IDE (Integrated Development Environment) helps developers write and manage code efficiently. Main roles of an IDE: Code editor with syntax highlighting Error detection Debugging support Code execution from one place Auto-completion and suggestions Example IDEs: VS Code, PyCharm, Eclipse
- How do comments help in real projects?
Answer: Comments improve code readability and maintainability. They help to: Explain logic to other developers Understand code after a long time Debug and maintain large projects Document complex logic In team projects, comments are very important for collaboration.
- How do you take user input in Python?
Answer: Python uses the input() function to take user input. Example: name = input("Enter your name: ") The input is taken as a string by default. For numeric input, we convert it using int() or float().
OUTPUT OF THIS PROGRAM :