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...
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...
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...
This looks long but it is easy just having some trouble please help out thank you. Find and fix all syntax and semantic errors which prevent the program from compiling. Find and fix all logical errors which cause the program to crash and/or produce unexpected results. In addition to making sure the code compiles, we have one final method which we need to complete. There is a method in the code, printAll, which is responsible for printing out the entirety...
Please help me with the code. Thank you! Description James Vond has delivered us some intel that the enemy perpetrators have been tricked into going to a bank that we've wired and booby-trapped. However, we have not gotten a bank system in place and you are the only person who is capable of handling such a task. We need this plan to go off without a hitch because the money we'll be receiving will give us insight on the hideout's...