Question

In: Computer Science

1. What is a Python script? 2. Explain what goes on behind the scenes when your...

1. What is a Python script?

2. Explain what goes on behind the scenes when your computer runs a Python program.

Solutions

Expert Solution

1)

Ans :- Python script means a script or code which is read and executed by interpreter line by line and by translating and execution by interpreter at a time, it is called python script.

Means you can execute a single line of code in the python but in the java we can't we need to declare class and main then execute that line means it is run by JVM

2)

Ans:- The python program executed in following scenario

Source code -> Compiler -> Byte Code -> Virtual Machine -> Running the code and virtual machine accepts the library modules.

In the Interpreter the compiler will compiles your source code (the statements in your file) into a format known as byte code. Compilation is simply a translation step. Byte code is intermediate code and platform independent

then byte code goes in virtual machine and virtual machine include the supported modules for the program and execute it.

Please let me know if you have any doubt or modify the answer, Thanks :)


Related Solutions

Ex. 1.Create a Python script . Write a program that goes through a tupple of numbers...
Ex. 1.Create a Python script . Write a program that goes through a tupple of numbers representing the temperatures taken at regular intervals in a day, at least 6 of them. The program should store this tupple in a variable, and then computing the average temperature. For that, use a for loop going over the temperature and adding all the values to a variable sum, initialized as 0. Then at the end, divide the sum by their count, and output...
(1) Explain the science behind a low fat diet. (2) what are the benefits of a...
(1) Explain the science behind a low fat diet. (2) what are the benefits of a low fat diet? (3) what types of foods would be used for a low fat diet? (4) Would a low fat diet lower risk of developing alzheimers?
#python. Explain code script of each part using comments for the reader. The code script must...
#python. Explain code script of each part using comments for the reader. The code script must work without any errors or bugs. Ball moves in a 2D coordinate system beginning from the original point (0,0). The ball can move upwards, downwards, left and right using x and y coordinates. Code must ask the user for the destination (x2, y2) coordinate point by using the input x2 and y2 and the known current location, code can use the euclidean distance formula...
1. Find out what a race condition is, and explain in your own words what goes...
1. Find out what a race condition is, and explain in your own words what goes wrong.
create a Python script that prompts the user for a title, description, and filename of your...
create a Python script that prompts the user for a title, description, and filename of your Python program and add the following to the bottom of the existing homepage: Add the post title with an emphasis Add the post description beneath the post title Create a hyperlink to the Python file using the filename input Create another hyperlink to the page you will create in the Web Showcase assignment
Python 1.Explain what happens when a program receives a non-numeric string when a number is expected...
Python 1.Explain what happens when a program receives a non-numeric string when a number is expected as input, and explain how the try-except statement can be of use in this situation. 2.What is meant by the state of an object, and how does the programmer access and manipulate it? 3.Explain the differences between instance variables and temporary variables. Focus on their visibility in a class definition, and on their roles in managing data for an object of that class. 4.Explain...
Explain in your own words the steps the Federal Reserve goes through when conducting a contractionary...
Explain in your own words the steps the Federal Reserve goes through when conducting a contractionary open market operation. When and why might the Federal Reserve do this? 300 words
1. explain the structural principles behind the gram stain. 2. what can you learn by conducting...
1. explain the structural principles behind the gram stain. 2. what can you learn by conducting a gram stain ?
Python Create a Python script file called hw3.py. Ex. 1. Write a program that inputs numbers...
Python Create a Python script file called hw3.py. Ex. 1. Write a program that inputs numbers from the user until they enter a 0 and computes the product of all these numbers and outputs it. Hint: use the example from the slides where we compute the sum of a list of numbers, but initialize the variable holding the product to 1 instead of 0. print("Enter n") n = int(input()) min = n while n != 0: if n < min:...
In python, Part 1: Estimate the value of e. e is defined as  as n goes to...
In python, Part 1: Estimate the value of e. e is defined as  as n goes to infinity. So the larger the value of n, the closer you should get to e. math.e is defined as 2.718281828459045 You'll write a program that uses a while loop to estimate e to within some defined error range, while having a limit on how many iterations it will attempt. Part 2: Palindrome detection A palindrome is a string that is the same forwards and...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT