Develop a few simple Python programs and show they will translate and run.

Develop a few simple Python programs and show they will translate and run.
May 19, 2020 Comments Off on Develop a few simple Python programs and show they will translate and run. Uncategorized Assignment-help
Words: 426
Pages: 2
Subject: Uncategorized

Develop a few simple Python programs and show they will translate and run.Experience error messages when you enter bad syntax the interpreter cannot understand.Discussion:The best way to learn Python (or any programming language) is to write & run Python programs. In this lab you will enter two programs, and run them to produce the output. Then deliberately insert syntax errors to see what kinds of error messages you get. Finally, you will be given a “specification” of a simple problem to solve. From this specification create a program, and run it against a set of specified test values. Properly document the last program so another person can read it and determine its purpose.Specifications:1. Using IDLE IDE to create a source code file named welcome.py, enter the following Python code, translate it and run it.def main(): print(“Welcome to the wonderful world of Python programming!”)main()After a successful run, capture its output and close its workspace.2. Perform the same steps described in part 1 for the following program:def main(): integer1 = int(input(“Enter first integer”)) # prompt and enter the first integer integer2 = int(input(“Enter second integer”)) # prompt and enter the second integer sum = integer1 + integer2 # generate and assign the sum print(“The sum of”, integer1, “and”, integer2,”is”, sum) # print sum difference = integer1 – integer2 # assignment of difference print(“The difference of”, integer1, “minus”,integer2, “is”, difference) # print differencemain()3. “Comment-out” the second line of the second program so it looks like this: # integer1 = int(input(“Enter first integer”)) # prompt for and input first integerTry to run the modified program and record (and hand in) the error message(s). 4. Remove the comment symbol from the previous part (i.e., restore your program toits previous working condition) and then comment-out the sum assignment statement like this: # sum = integer1 + integer2 # assignment of sum Run the modified program and capture the error message(s) you see.5. Restore your working program again and then comment-out the code line, # difference = integer1 – integer2 # assignment of differenceOnce again run the modified program and capture the error message(s) you see. Explain why the error message you got when commenting out the sum statement differs than when commenting out the difference statement. 6. Problem: Design, Develop, Integrate, and Test (DDI&T) a Python program that converts a Fahrenheit temperature into its Celsius temperature equivalent. The formula for converting Fahrenheit to Celsius is, Celsius = 5.0/9.0*(Fahrenheit – 32.0)Your program should prompt the user for a Fahrenheit temperature, convert it to Celsius and then output both values in the following format: Fahrenheit Temperature = Celsius Temperature =