Write a program that has two functions main() and validate(). Use these two functions to get colors from the user and validate it against the KnownColors list. indicate to the user that the input was valid or not. The program should only end when the user enters in exit. KnownColors = I'red'. 'areen' 'blue' vellow' orange', indigo'l
Q: Write a program called a2_q1.py that asks the user (business owner) for their product information…
A: class a2_p1(object): def validateAndDisplayMenu(self,num): #function to prompt user…
Q: Write a program that reads a list of integers, and outputs whether the list contains all even…
A: Solution: Given, Write a program that reads a list of integers, and outputs whether the list…
Q: Write a program that first gets a list of six integers from input. The first five values are the…
A: Program: //include the required header file #include<iostream> using namespace std; void…
Q: Write a Python program that prompts the user to enter a sentence of at least 5 words. Include a test…
A: Given: Write a Python program that prompts the user to enter a sentence of at least 5words. Include…
Q: Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating…
A: Actually, java is a object oriented programming language. It is a platform independent.
Q: Write a program that reads a list of words. Then, the program outputs those words and their…
A: In main all the variable and vector declared.push_back() function is used to insert the words in…
Q: Write a program that reads a list of words. Then, the program outputs those words and their…
A: Since here, no programming language is specified. So, we are providing the program code in C++. The…
Q: Python programming question: I have a 2d list [[1134],[2221],[3321],[2324]]. It is outputted as…
A: In the solution of given problem, we input row number and column number of element as a replacing…
Q: You have a list of student ID’s followed by the course number (separated by a space) that the…
A: import java.util.ArrayList; import java.util.HashMap; import java.util.Scanner; public class Main{…
Q: Write a program that reads form the keyboard student test scores in the range 0 – 100, and store…
A: I give the code in python and use all three functions as per your requirement and provide the output…
Q: Write a function called find_max that takes a two-dimensional list as a parameter and returns the…
A: program code : // C# program to find row with// max sum in a matrixusing System;using…
Q: for my python class, I need to write a program that has a list that stores repeated heart-rate…
A: Average of heart rate in python . The heart rates are stored in a list
Q: Write a program that accepts the total number of input values that the user will provide and…
A: Given :- Write a program that accepts the total number of input values that the user will provide…
Q: Write a program that reads a list of integers, and outputs whether the list contains all multiples…
A: Python Program: # function for checking if all elements are multiple of 10def…
Q: in coral language Write a program that first gets a list of 5 integers from input. Then, get another…
A: Actually, program is a executable software that runs on a computer.
Q: End of semester grades are quickly approaching and some nice guy hacker wants to write a function…
A: Solution: Given, End of semester grades are quickly approaching and some nice guy hacker wants to…
Q: Arun is a sequence of adjacent repeated values. Write a program that generates a sequence of 20…
A: Note: This code should be rewritten instead of copying to the compiler otherwise it will throw a…
Q: Write a function count_repeated that takes two lists as a parameters and prints out the number of…
A: I give the code in Python along with output and code screenshot
Q: Write an application that reads a user basket list and produces the bill receipt. Check the given…
A: Problem: An online grocery store sells items on a web page. A user adds items to a basket and he…
Q: Write in Python: A contact list is a place where you can store a specific contact with other…
A: User want to enter list of name and contact. Enter space after completing name and contact number.…
Q: We need to store information about each student in a class of N students. For example,name,…
A: Program: #include <iostream>using namespace std; //defintion of class Studentclass Student{…
Q: Task Write a program that can dynamically change the font of a text in a label displayed on a stack…
A: GIVEN: Write a program that dynamically changes the font of a text.
Q: Write a python program to display a receipt of ordered foods by a customer at a restaurant. The…
A: Based on python
Q: Write a program (not a function!) that asks the user for nonnegative integers, one integer per line.…
A: Note : As per no Programming language is mention so I will do this using programming language…
Q: Write a program (not a function!) that asks the user for nonnegative integers, one integer per line.…
A: Sample Code Output 1: Sample Code Output 2:
Q: Write a program that reads form the keyboard student test scores in the range 0 - 100, and store…
A: As the language is not specified answer written in python
Q: Write python program that reads from an input file “scores.txt” student test scores in the range 0 –…
A: def readData(): file1 = open('/Users/sandeep/PycharmProjects/pythonProjects/venv/phase1.txt','r')…
Q: Write a program called a2_q1.py that asks the user (business owner) for their product information…
A: Answer: Here we have to determine python code for business owners program. Python programming…
Q: Write a function swap that swaps the first and last elements of a list argument. Sample output with…
A: code snippet:
Q: Write a Python function which takes an integer as parameter. The integer is either equal to 1 or is…
A:
Q: Write a python program that asks a user (business owner) for their product information and creates…
A: # This loop will go on until the budget is integer or floatwhile True: try: bg = float(input("Enter…
Q: t allows the user to enter the series of game points, then -1 to signal the end of the list.
A: Approach Here, while loop executes until the user entered -1. In each iteration, the sum is computed…
Q: Write
A: Answer:- Program Screenshot: file.txt
Q: In Python use the Design Recipe to write a function, count_odds, that consumes a list and two…
A: Program Instructions:Write the function header and type contrast of the program.Write description…
Q: Write a program that reads a list of integers from the keyboard and creates the following…
A: PROGRAM CODE: #include <iostream> // include header file for input output…
Q: The program requires me to remove all item for a list, but when doing the test case for it, it only…
A: Solution: I have analyzed you code and we found some mistake
Q: Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating…
A: Objective: This program reads a maximum of 20 Strings until the user inputs the sentinel value ZZZ.…
Q: In Python: Write a function that takes in two lists (A and B) as parameters, and an integer (sum).…
A: Given data, Write a function that takes in two lists (A and B) as parameters, and an integer (sum).…
Q: Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating…
A: import java.util.ArrayList;import java.util.Scanner; public class CategorizeStrings { public…
Q: the numbers that are present in both lists. See sample lists and output below. Input two sets of…
A: given - Write a program that asks the user to input 2 lists of numbers, 5 numbers per list. Your…
Q: Write a program that asks the user to input 2 lists of numbers, 5 numbers per list. Your program…
A: Given: Write a program that asks the user to input 2 lists of numbers, 5 numbers per list. Your…
Q: Given a list of items with a value, and a start and end flag, implement a function that calls…
A: Answer is given below-
Q: A contact list is a place where you can store a specific contact with other associated information…
A: Please find the answer below :
Q: Please write a program that checks if the last data item entered appears earlier in the list. The…
A: Coded using Python 3.
Q: Write a program that reads integers from the user and stores them in a list. Yourprogram should…
A: """Program to reads integers from the user and display from smallest to largest""" #create an…
Q: Write a program that reads a list of integers, and outputs whether the list contains all even…
A: PROGRAM: #Function definition def is_list_even(my_list): #Iterating list elements for x in…
Q: Write a program that reads a list of integers, and outputs whether the list contains all multiples…
A: Answer
Q: Write a program that replaces words in a sentence. The input begins with word replacement pairs…
A: Python code: File name: “main.py” def main(): replacement_pairs = input() replacement_pairs…
Q: Write a function called seq that takes an input number N and returns a list containing the sequence…
A: In this program we are going to get the list of N numbers and check a condition if the number exists…
Language Python
Step by step
Solved in 2 steps with 2 images
- Write a function that takes two arguments, a list L1 and a list L2. • If the length of the list L1 is greater than twice the length of the list L2, then append the first three values of L1 to the three last values of L2. E.g. if L1 = ‘(1 2 3 4 5 6 7) and L2 = ‘(8 9 10), then return ‘(1 2 3 8 9 10) Should be written in the Racket programming languageEnd of semester grades are quickly approaching and some nice guy hacker wants to write a function called "raiseGrades" that will take in a list of grades and add 5 to the total of each one. Not to look fishy, if the grade goes over 100, you will need just set it to 100. Return the list back. Example Input: 90, 95, 99 Example Output 95, 100, 100in python """Write a function get_new_grades, such that given a string of grades as an input parameter,returns two objects:the initial grades as a list of numerical valuesas well asa new list with the numerical values, where the scores that are less than 50 are replaced by 50. """
- In Python use the Design Recipe to write a function, count_odds, that consumes a list and two integers, lower_bound and upper_bound, and returns the number of all the odd integers in the list that are between lower_bound and upper_bound (inclusive of both lower_bound and upper_bound). Include a docstring!Write a program that first gets a list of six integers from input. The first five values are the integer list. The last value is the upper threshold. Then output all integers less than or equal to the threshold value. Ex: If the input is 50 60 140 200 75 100, the output is: 50 60 75 For coding simplicity, follow every output value by a space, including the last one. Such functionality is common on sites like Amazon, where a user can filter results. Your program should define and use a function: Function outputIntsLessThanOrEqualToThreshold(integer array(?) userVals, integer upperThreshold) returns nothingWrite a program that reads a list of integers, and outputs whether the list contains all multiples of 10, no multiples of 10, or mixed values. Define a function named is_list_mult10 that takes a list as a parameter, and returns a boolean that represents whether the list contains all multiples of ten. Define a function named is_list_no_mult10 that takes a list as a parameter and returns a boolean that represents whether the list contains no multiples of ten. Then, write a main program that takes an integer, representing the size of the list, followed by the list values. The first integer is not in the list. Ex: If the input is: 5 20 40 60 80 100 the output is: all multiples of 10 Ex: If the input is: 5 11 -32 53 -74 95 the output is: no multiples of 10 Ex: If the input is: 5 10 25 30 40 55 the output is: mixed values The program must define and call the following two functions. is_list_mult10() returns true if all integers in the list are multiples of 10 and false otherwise.…
- Write a program that reads a list of integers, and outputs whether the list contains all multiples of 10, no multiples of 10, or mixed values. Define a function named is_list_mult10 that takes a list as a parameter, and returns a boolean that represents whether the list contains all multiples of ten. Define a function named is_list_no_mult10 that takes a list as a parameter and returns a boolean that represents whether the list contains no multiples of ten. Then, write a main program that takes an integer, representing the size of the list, followed by the list values. The first integer is not in the list. Ex: If the input is: 5 20 40 60 80 100 the output is: all multiples of 10 Ex: If the input is: 5 11 -32 53 -74 95 the output is: no multiples of 10 Ex: If the input is: 5 10 25 30 40 55 the output is: mixed values The program must define and call the following two functions. is_list_mult10() returns true if all integers in the list are multiples of 10 and false otherwise.…In Python: Write a function that takes in two lists (A and B) as parameters, and an integer (sum). Both lists have the same size. The function returns True if there are two numbers: a in A, and b in B, where a + b = sum. The function must run in O(nlogn), where n is the size of any of the two listsWrite a program that reads a list of integers, and outputs whether the list contains all even numbers, odd numbers, or neither. The input begins with an integer indicating the number of integers that follow. Your program must define and call the following two functions. is_list_even() returns true if all integers in the list are even and false otherwise. is_list_odd() returns true if all integers in the list are odd and false otherwise.def is_list_even(my_list)def is_list_odd(my_list)
- Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list. For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered. import java.util.*; public class CategorizeStrings { publicstaticvoidmain (String[] args) {Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list. For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered. code given import java.util.*; public class CategorizeStrings { publicstaticvoidmain (String[] args) { // your code here } // display() }Write an application that accepts up to 20 Strings, or fewer if the user enters the terminating value ZZZ. Store each String in one of two lists—one list for short Strings that are 10 characters or fewer and another list for long Strings that are 11 characters or more. After data entry is complete, prompt the user to enter which type of String to display, and then output the correct list. For this exercise, you can assume that if the user does not request the list of short strings, the user wants the list of long strings. If a requested list has no Strings, output The list is empty. Prompt the user continuously until a sentinel value, ZZZ, is entered. import java.util.*; public class CategorizeStrings { publicstaticvoidmain (String[] args) { // your code here } // display() }