
PLEASE ADD COMMENTS EXPLAINING EACH LINE OF CODE
THANK YOU
numbers = [3,5,7,9]
#looping through valid indexes
for i in range(len(numbers)):
#printing value at index i
print(numbers[i])
PLEASE ADD COMMENTS EXPLAINING EACH LINE OF CODE THANK YOU QUES TION 7 10 points Save...
Matlab. Please add comments. Thank you in advance.
15. Write a code that can read in a string and replaces all vowels with x's 16. Write a function that reads in a D array of any length, u, and swaps elements of the array in the following way. The first and last element are swapped. The second and second to last element are swapped. The third and third to last element are swapped, and so on until all the elements...
python programming: Can you please add comments to describe in detail what the following code does: import os,sys,time sl = [] try: f = open("shopping2.txt","r") for line in f: sl.append(line.strip()) f.close() except: pass def mainScreen(): os.system('cls') # for linux 'clear' print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") print(" SHOPPING LIST ") print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") print("\n\nYour list contains",len(sl),"items.\n") print("Please choose from the following options:\n") print("(a)dd to the list") print("(d)elete from the list") print("(v)iew the...
Add high level comments throughout the program to explain what each line of code does. Finally, use a diagramming tool (Visio, Lucidchart, MSPaint, paper & pen) to create a flowchart of the code below. path = "/Users/user1/data/baby_names/" myyear = input("Please provide the year to be searched:") babyname = input("Please provide the baby name to be searched:") babyname = babyname.capitalize() baby_counts = count_babies(myyear, babyname) print("There were {0} boys and {1} girls with that name in {2}".format( baby_counts[0], baby_counts[1], myyear)) def count_babies(year,...
Can you add code comments where required throughout this Python Program, Guess My Number Program, and describe this program as if you were presenting it to the class. What it does and everything step by step. import random def menu(): #function for getting the user input on what he wants to do print("\n\n1. You guess the number\n2. You type a number and see if the computer can guess it\n3. Exit") while True: #using try-except for the choice will handle the...
Can you please complete it in java and add comments explaining
the program so I can understand it.
Test cases:
Test case 2 input
PROBLEM: Evaluate a prefix expression. The operands in the expression are single digit whole numbers. The operators are binary addition (+), subtraction (), and multiplication(*), and a trinary operator "switcher" (a). The a operator of a, b, and c returns b when a is positive; otherwise, it returns Example 1: * + 4 53 1 simplifies...
Can someone please read the above directions and then
add to the code I provided! its c++ thank you!
Week 5: Add arrays to your program to handle more data. Examples: In the programming tutorial, add a tutorial on working with arrays. Then use arrays to store the answers to multiple questions so that you can compute a total score. In the DJ program, you can add the ability to handle multiple songs and playlists. The electrical program should handle...
VERY URGENT*** THANK YOU IN ADVANCE: THIS IS THE CODE I HAVE GOTTEN SO FAR: PYTHON This is a code that is supposed to help someone study/ practice for jeopardy. The two functions described below are required for this assignment. You may add other functions that you think are appropriate: menu() This function, which displays all the user options to the screen, prompt the user for their choice and returns their choice. This function will verify user input and ALWAYS...
Please code in MatLab or Octave
Output should match Sample Output in Second Picture
Thank you
5. In this problem we will investigate using the Secant Method to approximate a root of a function f(r). The Secant Method is an iterative approach that begins with initial guesses , and r2. Then, for n > 3, the Secant Method generates approximations of a root of f(z) as In-1-In-2 n=En-1-f (x,-1) f(Fn-1)-f(-2) any iteration, the absolute error in the approximation can be...
Need help with this C++ assignment, please use comments so I can better understand your code like comments above your function header explaining what the function does and the purpose of each variable. etc. Assignment: Write a C++ program that reads a text file containing a list of movies "Movie_entries.txt" . Each line in the file contains tile, director, genre, year released and running time of a specific movie. Each field is separated by comma. Print out movie titles sorted...
Please help with this, and leave comments explainging the code you wrote, thank you for your help Write a Lottery class that simulates a 6-number lottery (e.g. "Lotto"). The class should have an array of six integers named lotteryNumbers, and another array of six integers named userLotteryPicks. The class' constructor should use the Random class to generate a unique random number in the range of 1 to 60 for each of the 6 elements in the lotteryNumbers array. Thus, there...