Question: Write Python program for the following questions: Make sure to include comment in the beginning of the program and throughout your code explaining the key

Write Python program for the following questions:

Make sure to include comment in the beginning of the program and throughout your code explaining the key steps of the program

Your program must contain a standard heading once at the top of your program as follows:

  • Your full name:
  • Date of completion:
  • Brief explanation of the program:
  • You must also document key steps of the program such as major input, processing, and output sections throughout your code.

I (10 Points)

Write a code that opens the number_list.txt file, uses a loop to write all the even numbers between 1 through 100 to the file and then closes the file.

II(10 Points)

Write a code that reads the number_list.txt file and adds all the numbers and prints the total.

III (10 Points)

Write a program that asks the user to a series of 10 numbers. The program should store the numbers in a list and then display the following data:

  • The lowest number in the list
  • The highest number in the list
  • The total of the numbers in the list

You can write the answers of the following in text file and submit for you can use the text entry available here.

IV

  1. (1 Point) what does the following Python statement do?

    abc = [100]*10

  2. (2 Points)What would be the value of the variable list after the execution of the following code? list = [1, 2, 3, 4] list[3] = 10
  3. (3 Points)What would be the value of the variable list2 after the execution of the following code? list1 = [1, 2, 3] list2 = list1 list1 = [4, 5, 6]
  4. (4 Points)Here is a list: namesList = ["Jane", "John", "Jim", "john", "Jasmine"] Write a Python code asking the user for a name and then use If statement to check if the name user entered is found in the list. If the name is in the list print "Found the name" if not then print "Sorry the name is not in the list".

Previous

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!