USE PYTHON Given: items = ["mask", "gloves", "soap"] Write a loop that will print to the screen "I've got ______" for every item in the list of items. Sample output: I’ve got mask. I’ve got gloves. I’ve got soap. I’ve got sanitizer. I’ve got . Note: There is a period at the end of each line.
Q: using python language Create the following list of numbers: [3,7,5,2,9,7] Write a while loop that…
A: Algorithm: 1. Start 2. Initialize list 3. Initialize i to 0 4. Check while loop condition 5. If…
Q: Find the numbers that can be expressed as the product of two nonnegative integers in succession and…
A: Answer:-
Q: 1. Please leave comments on the code below as explanations of what it does: def…
A: Ans:) In this program, the two parallelograms are created and printed, one is completely filled…
Q: Please help!! I don't understand most of the code. Please leave comments as explanations on every…
A:
Q: PYTHON Write a Python program that uses an expanded version of [0-9][0-9.,]* to recognize all the…
A: The program will utilize switch-case to go over each digit of the number. As there are only 10…
Q: task5.c A Guessing Game Asking user to guess a number, only stop when the number is guessed…
A: Ans: Code: #include <stdio.h>#include <stdlib.h>int main(){ int randomnumber;…
Q: thon Geography Grades 2 Make a copy of your program for the problem Geography Grades 1 and change…
A: It is defined as an interpreted, object-oriented, high-level programming language with dynamic…
Q: I cant get it right. Modify the BarChart program from Chapter 6 Exercise 13 to accept the number…
A: Algorithm: Start Read points scored by each player in a season Divide the points of each player by…
Q: Python) Given the code that reads a list of integers, complete the number_guess() function, which…
A: import random def number_guess(i): num= random.randint(1,100) if i< num: printf(i,…
Q: In JavaScript, there are two types of comments: 1. Single-line comments start with // 2. Multi-line…
A: Coded using JavaScript.
Q: Write a program called StudentTable that prints the below table. Use only print() orprintf(). DO NOT…
A: The "print()" and "printf()" function are available in C language and "println()" function is only…
Q: #includecstdio.h> wincludecmath.h> main () int a,b,c,s,areaj printf("Enter the value of side a:");…
A: Compile time error: An error in syntax or semantics (such as missing semicolon, or reserved keyword…
Q: Assignment4A: Let's Play Bunco! Now that we are able to repeat actions easily with loops, we can…
A: the code is given below:
Q: Please solve this using java Write an application that allows a user to enter the names and birth…
A: According to question: We have to write code for an application that allows a user to enter the…
Q: Question Completion Status: def printing(pattern, number): for i in range(number): print ("**")…
A: According to the Question below the Solution: Output:
Q: PLEASE READ THE QUESTION AND DON'T JUST COPY PASTE THE ANSWER FROM ANOTHER QUESTION, THE PREVIOUS…
A: s=input("Enter student full names: ")l = list(map(float,input("Enter 3 marks separated by spaces:…
Q: Java) The objective is to write a program that reads CSV data and emits HTML data. The program…
A: Please find a crude implementation below. The question is complex and may thus, need more polishing.
Q: The bin packing problem is to pack theobjects of various weights into containers. Assume each…
A: Since you are not mentioning the programming language, here we are using Java to complete the…
Q: aput by the user. Run it, using an upper limit of 9. Oops! an infinite loop. Why? There are two…
A: These programs can be asked from control statements, array, string, oops etc. Java basic programs…
Q: Language: Python with Turtle Write a program that will have Turtle draw a row of 40 circles across…
A: Our task is to draw a 40 circles in a row using turtle. The circles should not overlap each other.…
Q: A regular polygon is an n-sided polygon inwhich all sides are of the same length and all angles have…
A: Program: //header file import java.util.Scanner; //definition of main class public class Main {…
Q: Code with comments and output screenshot is must for an Upvote. Thank you! Using Java: Create a…
A: import java.io.*; import java.util.*; public class sort_class implements Serializable_class {…
Q: In JavaScript, there are two types of comments: 1. Single-line comments start with // 2. Multi-line…
A: Coded using JavaScript.
Q: Write a program called StudentTable that prints the below table. Use only print() or printf(). DO…
A: Code: #include<stdio.h>int main() { char h[4][50]={"Name","Lab","Bonus","Total"}; char…
Q: Exercise 4: Write a program (Lab8_ex4_ld.py) that generates a random even positive integer less than…
A: code :-- # for genrate random module import random# genrate random even number between 0 to 10…
Q: makebecisionForTask2() function in this ta: n this task, the exit may be to the left or to the right…
A: I'm provided the answer below as per question:
Q: a and b are int variables containing values, and a > b. Write a for loop that prints even integer…
A: import java.util.Scanner; public class evenRange { public static void main(String[] args)…
Q: The filter words counts the number of words in input as long as each word is separated from the next…
A: Objective: A source program is provided to determine the word count by taking characters from the…
Q: 4th Edition P767 2(d) Use your wits to construct a DFA for the following regular expression: ab* +c…
A: According to the Question below the Solution:
Q: #include using namespace std; void insertElement(int* LA, int ITEM, int N, int K) { int J=N;…
A: Step 1:- Program Explanation:- 1.In this program, we insert element 6 at the index of 3 in the array…
Q: python nMath: pentagonal numbers) A pentagonal number is defined as n(3n-1)/2 for n=1,2,..., and so…
A: Declare a count variable that is used to display the first 10 numbers in each line. Using for loop,…
Q: WorkArea Results Given an int variable k that has already been declared, write some code that uses a…
A: As I am writing the code in my local system, so I have first of all declared a variable k. Next, I…
Q: :* Write *3 code snippet each in python* that contains For loop, While loop and loop recursion. Copy…
A: Python provides different ways for executing the loops. While all the ways provide similar basic…
Q: Use the circle_at () function from Section 1.3 to write a program that draws circles centered at the…
A: The Output will be 8 circles with center as origin
Q: please code in python You place a pawn at the top left corner of an n-by-n chess board, labeled…
A: Below is the Answer: Here is the completed code for this problem. Comments are included, go through…
Q: different procedures defined with def ()
A: #GPA Calc #Lists classes= [] grades = [] #Collects the data of Class names and Grades in Letter…
Q: For this problem set, you will submit java file named Homework.java Return Growing NumList This…
A: Java program used to answer this question
Q: Python Coding-(On Pycharm Community Edition) Create a mini-lottery with TEXT ticket. The user…
A: Program Instruction:First import the module of the random numbers.Then read the file ‘ticket.txt’…
Q: (Python) Given the code that reads a list of integers, complete the number_guess() function, which…
A: In this question, partially code is given and we have to generate random number and compare them…
Q: please code in python refer to the answer of this question:…
A: Answer: I have done code and also I have attached code.
Q: Implement the following: 1) Use a loop to continuously request an integer input from the console. 2)…
A: Given program is below with commented explanation and output.
Q: se try and except . Create a program that uses a loop to provide a k ? k times table similar to the…
A: Input : Input k value Output : Output the table
Q: write a program to create a vending machine. the program should display at least 5 items, ask the…
A: Algorithm: Start the program. Display the items in the vending machine. Choose the items. Ask for…
Q: write the pseudocode to complete these tasks: In the same M5Lab1ii file, start a second module…
A: Actually, program is an executable software that runs on a computer.
Q: It is a common error to accidental repeat a word. Write a program that reads a sentence, a word at a…
A: Code And Output given below
Q: • Ignore all lines that begin with #. These represent comments in the data that should not be…
A: Answer: I have done code and also I have attached code.
Q: The Mastermind game board game is a code breaking game with two players. One player (your program)…
A: import randomsecretCode =[]for i in range (0,4): n = random.randint(1,9)…
Q: Lhe year ne of the months of the year - etc. ne you have the assignment xs Write a loop that prints…
A: Question 4: a) In the first part we have to traverse the list.
Q: Code with comments and output screenshot Use python to write following code. To make a 4x4 grid…
A: Required: Use python to write following code. To make a 4x4 grid which have two 2s in random…
USE PYTHON
Given: items = ["mask", "gloves", "soap"]
Write a loop that will print to the screen "I've got ______" for every item in the list of items.
Sample output:
I’ve got mask.
I’ve got gloves.
I’ve got soap.
I’ve got sanitizer.
I’ve got <user item>.
Note: There is a period at the end of each line.
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Starting with the following code, add a loop that will prompt the user for the number of math questions the user would like to be presented with: import randomfirstnum = random.randrange(1,11) # return an int from 1 to 10secondnum = random.randrange(1, 11)compsum = firstnum + secondnum # adds the 2 random numbers together# print (compsum) # print for troubleshootingprint("What is the sum of", firstnum, " +", secondnum, "?") # presents problem to useradded = int(input("Your answer is: ")) # gets user inputif added == compsum: # compares user input to real answer print("You are correct!!!")else: print ("Sorry, you are incorrect")Hi would you be able to modif the menu methode in my code below with the signature public static int menu() The menu should print all of the choices and ask the user to enter a choice. Then menu should declare to read the integer representing the user's choice. This int should be returned to the user. • do { • choice = menu(); • ,,, • ,,, • } while(choice !=5; import java.util.ArrayList;import java.util.Scanner;public class TestProgram {public static void main(String[] args) {ArrayList<Solid> solids = new ArrayList<>();Scanner scanner = new Scanner(System.in);int choice;do {choice = menu();switch (choice) {case 1:System.out.println("Enter radius of sphere:");double radius = scanner.nextDouble();solids.add(new Sphere(radius));break;case 2:System.out.println("Enter radius and height of cylinder:");double cylRadius = scanner.nextDouble();double height = scanner.nextDouble();solids.add(new Cylinder(cylRadius, height));break;case 3:for (Solid solid : solids)…Please help!! I don't understand most of the code. Please leave comments as explanations on every line of the code. def repeatChar(numRepeats, outputChar):'''output the outputChar numRepeats times'''for colNo in range(numRepeats):print(outputChar, end='')def Parrallelogram(side, char):for i in range(side):repeatChar(i+1, char)print()for i in range(side):repeatChar(i+1, ' ')repeatChar(side-i-1, char)print()def outlineParallelogram(side, char):for i in range(side):if (i < 1):repeatChar(1, char)elif(i == 1):repeatChar(2, char)else:repeatChar(1, char)repeatChar(i-1, ' ')repeatChar(1, char)print()for i in range(side-1):if (i == side-2):repeatChar(side-1, ' ')repeatChar(1, char)else:repeatChar(i+1, ' ')repeatChar(1, char)repeatChar(side-i-3, ' ')repeatChar(1, char)print()print('This program will show a parallelogram and its outline')number = int(input('How long do you want each side to be? '))character = input('Enter the character: ')Parrallelogram(number,…
- CHALLENGE ACTIVITY 8.3.3: Hourly temperature reporting. Write a loop to print all elements in hourly_temperature. Separate elements with a -> surrounded by spaces.Sample output for the given program with input: '90 92 94 95'90 -> 92 -> 94 -> 95 Note: 95 is followed by a space, then a newline. Use Python, please.1. Please leave comments on the code below as explanations of what it does: def repeatChar(numRepeats, outputChar):'''output the outputChar numRepeats times'''for colNo in range(numRepeats):print(outputChar, end='')def Parrallelogram(side, char):for i in range(side):repeatChar(i+1, char)print()for i in range(side):repeatChar(i+1, ' ')repeatChar(side-i-1, char)print()def outlineParallelogram(side, char):for i in range(side):if (i < 1):repeatChar(1, char)elif(i == 1):repeatChar(2, char)else:repeatChar(1, char)repeatChar(i-1, ' ')repeatChar(1, char)print()for i in range(side-1):if (i == side-2):repeatChar(side-1, ' ')repeatChar(1, char)else:repeatChar(i+1, ' ')repeatChar(1, char)repeatChar(side-i-3, ' ')repeatChar(1, char)print()print('This program will show a parallelogram and its outline')number = int(input('How long do you want each side to be? '))character = input('Enter the character: ')Parrallelogram(number, character)outlineParallelogram(number, character)print()Modify songVerse to play "The Name Game" (see OxfordDictionaries.com), by replacing "(Name)" with userName but without the first letter.Ex: If userName = "Katie" and songVerse = "Banana-fana fo-f(Name)!", the program prints:Banana-fana fo-fatie! Ex: If userName = "Katie" and songVerse = "Fee fi mo-m(Name)", the program prints:Fee fi mo-matie Note: You may assume songVerse will always contain the substring "(Name)" #include <iostream>#include <string>using namespace std; int main() {string userName;string songVerse; getline(cin, userName);userName = userName.substr(1, userName.size() - 1); // Remove first character getline(cin, songVerse); // Modify songVerse to replace (Name) with userName without first character /* Your solution goes here */ cout << songVerse << endl; return 0;} Please help me with this string operations problem using C++.
- Write a program which should handle books information for a book shop. It should be able to handle atleast 100 records. Your program should store following information against a book. Book Id (you may use index number as book ID) Book Code Book Name Author Name Publish Date Price No of copies in hand No of Copies sold Initialize 10 Books and initialize remaining with 0 and spaces. Create a menu, as given below, which should use above information to perform selected action from the given menu on the screen Add book (One book will be added. User will enter book id i.e. index number Record will be placed if code at that index is 0) Display book (Display Books in tabular format with nonzero codes only) Delete book (Place an empty record with 0 code and spaces at the selected index) Search book Sale book (First locate the book Id and check if code is not 0 then update No of Copies in hand and No of Copies sold accordingly) Exit Your assignment will be evaluated on the following basis:…the output is on the image. solve in python3.# Hangman Game # -----------------------------------# Helper code# You don't need to understand this helper code,# but you will have to know how to use the functions# (so be sure to read the docstrings!)import randomimport string WORDLIST_FILENAME = "words.txt" # Responses to in-game events# Use the format function to fill in the spacesresponses = [ "I am thinking of a word that is {0} letters long", "Congratulations, you won!", "Your total score for this game is: {0}", "Sorry, you ran out of guesses. The word was: {0}", "You have {0} guesses left.", "Available letters: {0}", "Good guess: {0}", "Oops! That letter is not in my word: {0}", "Oops! You've already guessed that letter: {0}",] def choose_random_word(all_words): """ Chooses a random word from those available in the wordlist Args: all_words (list): list of available words (strings) Returns: a word from the wordlist at…C++: Create a basic contact book where you can store and then retrieve contact information.The information that (at least) should be able to be stored is name (postal) address e-mail address telephone number Birthday, other. It should work as follows. The user should be able to choose what he wants to do, for example : add contact or find the phone number of a given contact. There are several ways to implement this, for example: • To have a menu where the user can choose by entering a number corresponding to one of the menu options. Exit should be one of the options. • where the user gives commands for what to do. The functionality that must exist is • to add a contact, • to delete a contact, • to search for a contact. The contact book should be saved in a file so that it does not disappear between runs of the program.
- How do I change this to a for next loop Private Sub btnNames_Click(sender As Object, e As EventArgs) Handles btnNames.Click Dim x As Integer = 0 Do While x < cboNames.Items.Count MessageBox.Show("Name #" & x + 1 & " is " & cboNames.Items.Item(x)) x += 1 Loop End SubJavaScript imageMosaic: compute image mosaic. You must implement the final version of the image mosaic algorithm we discussed in class (which includes the scaling of mosaic images and also randomization). Since the algorithm involves several nested loops and can take a while to run, this function will be implemented using a non-blocking loop so that the browser will not complain about its running speed. Details are in the comments embedded in the code. function imageMosaic(input, output, mosaic_name) { let width = input.width; let height = input.height; let mimages = mosaics[mosaic_name]; // mimages is an array of mosaic images let w = mimages[0].width; // all mosaic images have the same size wxh let h = mimages[0].height; let num = mimages.length; // number of mosaic images console.log('Computing Image Mosaic...'); let y = 0; (function chunk() { for(x = 0; x <= width-w; x += w) { // x loop // ===YOUR CODE STARTS HERE=== /* for(y=0; y<=input.height-h; y+=h) { for (x=0;…Write a code segment that searches a Grid object for a negative integer. The loop should terminate at the first instance of a negative integer in the grid, and the variables row and column should be set to the position of that integer. Otherwise, the variables row and column should equal the number of rows and columns in the grid. *Python