You develop a Python application for your company. A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding management. Which two code segments should you use? Each correct answer presents a complete solution. (Choose two.) Group of answer choices E. employees [0:-5] D. employees [0:-4] B. employees [:-5] A. employees [1:-4] C. employees [1:-5]
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 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: 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: python The intent of this program is to manage a set of contacts. Each contact will have data…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: Write a program to take a product code from Millie’s Mail- Order Catalog (MMOC) and separate it…
A: Approach Set the constant SIZE as 10 of the character array temp. Set the constant INPUT as 30 of…
Q: You develop a Python application for your company. A list named employees contains 200 employee…
A: Slicing in python can be done using : (colon) operator.
Q: Write a program in Java, Python and Lisp When the program first launches, there is a menu which…
A: Question: Write a program in Java, Python and Lisp When the program first launches, there is a menu…
Q: PYTHON CODING This function takes a list of points and then returns a new list of points, which…
A: def solution_path(points): temp=points # adding starting point\ path=[points[0]] #…
Q: Write a program called p2.py that contains a function called word_selection () that takes a list as…
A: user has to enter a word again and again for quit press 'q' and then program return rando word…
Q: Using C language, write a program that will display the menu as shown below. Write a function for…
A: CODE IN C:
Q: In a program, write a function that accepts two arguments: a list, and a number n. Assume that the…
A: The Рythоn greаter thаn ( left>right ) орerаtоr returns True when its left орerаnd…
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: For this week python assignment your task is to computer the queries in X Y z format where you are…
A: 1. Input m, q and the list 2. Now run a loop q times and in each iteration input x,y,z 2.1.…
Q: Write a program that takes 3 integers as an input from the user and display them in ascending order…
A: Required: Program to take user input for three numbers, sort them and print using functions.…
Q: One of your colleagues has started to a new project, which is a shop to sell mobile phones, and…
A: ALGORITHM:- 1. Take input for the items. 2. Store them into the array object of class Equipments. 3.…
Q: USE JAVA Write the code for this program to work: A personal phone directory contains room for…
A: Here is the java program: import java.util.*; class PhoneDirectory { public static void…
Q: Python programming. For this program, you need to write a function that processes a list, then…
A: Python Program def compound_interest(p, i, t): # Calculates compound interest Amount =…
Q: You have been asked to develop the new system. You are to write an application to assign seats in an…
A: Actually, program is a executable software that runs on a computer.
Q: please code in python A mining company conducts a survey of an n-by-n square grid of land. Each row…
A: ANSWER:-
Q: 1)Write a game of rock paper scissors, one of the choices will be from the user and the other from…
A: 1. Basically there are 3 possible input Stone Paper scissors So this is the concept of first…
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: Function name Description parameter Return type main() Handles the main None None functionality of…
A: The functions are given below,
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 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: In python, Problem Description: You are hosting a party and do not have room to invite all of your…
A: Given: In python, Problem Description:You are hosting a party and do not have room to invite all of…
Q: One of your colleagues has started to a new project, which is a shop to sell mobile phones, and…
A: Program for that organizes the list of store contents from (phones - chargers - headphones - phone…
Q: def thing2(lst: List[int]) -> None: """TODO: Enter your description of the runtime complexity of…
A: Time Complexity - Time complexity is used to measure computer time taken by algorithm/program, Ou…
Q: In python, create a sorted_grades application that can store up to 10 grades in order from highest…
A: l=[0]*10 def ent(l): n1=int(input()) l[1]=n1 l.sort() print("grade added") inp() def…
Q: In a program, write a function that accepts two arguments: a list, and a number n. Assume that the…
A: logic:- display_larger(lst,num) iterate from i=0 to i<len(lst) check if lst[i]>num…
Q: IN java script Create a function that takes the same group as number n and returns a list of two…
A: Process of Code: In this question we need to find out the value at lower index and higher index so…
Q: One of your colleagues has started to a new project, which is a shop to sell mobile phones, and…
A: # import pandas library as pd import pandas as pd # Read file, as specified in questiondetails =…
Q: #in c++
A: The algorithm for creating the program with given description is as follows: Create a class Student…
Q: Using Python This assignment is about temperatures and requires the main function and a custom…
A: import random;def main(): temperatures=[]; #inserting random values into list for i in…
Q: Suppose the owner of tuck shop gave you a file that contains the list of items, the number of items…
A: The C++ program requires an input file, that contains the data of the item names, number of items,…
Q: Write a program that reads a set of details for a group of employees and then can search based on…
A: n=int(input())l=[]for i in range(n): a=int(input("Employee no. :")) b=input("Employee name :")…
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: TOPIC IS FOR LOOPS (programming/python) You run a local girl's basketball league in your town. You…
A: Python programming language provides different types of loops to handle looping requirements. Python…
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: Brussel's choice def brussels_choice_step(n, mink, maxk): This problem is adapted from another…
A: Substring of a string in Python can be achieved in a number of ways. It's usually referred to as…
Q: Create a Python function, called Deux_S, that takes a list of numbers as a parameter and returns…
A: Solution Given,
Q: • Create an empty list of courses. • Prompt the user for a course they wish to enter, or to type…
A: Algorithm: Start Implement a method named display() that takes a list of courses as argument…
Q: The local driver's license office has asked you to create an application that grades the written…
A: Below is the Python code for the above application, along with some example output. Refer to the…
Q: Question: 1 Write a python program that will take input from the user until the user gives "STOP" as…
A:
Q: PYTHON!!!!! A group of statisticians at a local college has asked you to create a set of functions…
A: Program Approach: First creating three function for calculating mean, mode and median. Median…
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: One of your colleagues has started to a new project, which is a shop to sell mobile phones, and…
A: # import pandas library as pd import pandas as pd # Read file, as specified in questiondetails =…
Q: write program by oop c++ for 5 item One of your colleagues has started to a new project, which is a…
A: The program is written in C++ #include <iostream> #include<string>…
A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding
management.
Which two code segments should you use? Each correct answer presents a complete solution. (Choose two.)
Step by step
Solved in 3 steps with 1 images
- You have a list of student ID’s followed by the course number (separated by a space) that the student is enrolled in. The listing is in no particular order. For example, if student 1 is in CS100 and CS200 while student 2 is in CS105 and MATH210 then the list might look like this:1 CS1002 MATH2102 CS1051 CS200Write a program that reads data in this format from the console. If the ID is −1 then stop inputting data. Use the HashMap class to map from an Integer (the student ID) to an ArrayList of type String that holds each class that the student is enrolled in. The declaration should look like this:HashMap<Integer, ArrayList<String>> students =new HashMap<Integer, ArrayList<String>>();After all data is input, iterate through the map and output the student ID and all classes stored in the vector for that student. The result should be a list of classes organized by student ID.Your program has a list of professors and their office location and office hours per day of the week. The user will type either a professor’s name or day of the week. If they type a professor’s name, show that professor’s office location and office hours (all days of the week). You don’t have to do a name search, you can require the user type the professor’s name exactly right. If the user types a day of the week, show all professors and office location for professors that have office hours on that day of the week. You don’t really need to use time/date code like we did for the notebook, you can just match the day of week by the word (String) e.g., your data has “Wednesday” so if a user types exactly “Wednesday” it matches. This can all be done with hash maps (and loops / if’s / etc.) using JavaWrite code in C++, C# or Python to solve the following problem: In a party there are N persons and we have M raffles. One person may participate in any number of raffles (from 0 to M). At the end of the day, host of the party comes to you and gives you M lists. Each list contains multiple integer numbers which are the "raffle ID numbers" of the participants. Then, for each list an integer number, I, is announced to determine the winner of the raffle: the winner is the person with raffle ID number K such that K is larger than exactly I numbers in that list. To help the host to find the winners you want to write a program. Input Format First line of the input is N and M. Then, there are M lines, each one contains integer numbers between 1 and N. Each list may contain at most N numbers. At the end of each line there is -1. After these lines there is one line which contains M integers to announce the winners. If the j-th number in this line is I it means that the winner of list j…
- You develop a Python application for your company. A list named employees contains 200 employee names, the last five being company management. You need to slice the list to display all employees excluding management. Which two code segments should you use? Each correct answer presents a complete solution. (Choose two.) Group of answer choices employees [1:-5] employees [1:-4] employees [0:-5] employees [0:-4] employees [:-5]please code in python A mining company conducts a survey of an n-by-n square grid of land. Each row of land is numbered from 0 to n-1 where 0 is the top and n-1 is the bottom, and each column is also numbered from 0 to n-1 where 0 is the left and n-1 is the right. The company wishes to record which squares of this grid contain mineral deposits. The company decides to use a list of tuples to store the location of each deposit. The first item in each tuple is the row of the deposit. The second item is the column. The third item is a non-negative number representing the size of the deposit, in tons. For example, the following code defines a sample representation of a set of deposits in an 8-by-8 grid.deposits = [(0, 4, .3), (6, 2, 3), (3, 7, 2.2), (5, 5, .5), (3, 5, .8), (7, 7, .3)]Given a list of deposits like the one above, write a function to create a string representation for a rectangular sub-region of the land. Your function should take a list of deposits, then a set of parameters…For this problem set, you will submit java file named Homework.java Return Growing NumList This function will be given a single number, it should return a list of strings of numbers. Each string in the list will only contain a single number repeated an arbitrary amount of times. The number each string will contain will be equal to the current string's index+1. The number in the string should be repeated the same number of times as the string's index+1. Each number in the string should be separated by a space. This list should stop when its size equals the max number specified. Signature: public static ArrayList<String> returnGrowingNumList(int max) Example: INPUT: 3OUTPUT: [1, 2 2, 3 3 3] INPUT: 6OUTPUT: [1, 2 2, 3 3 3, 4 4 4 4, 5 5 5 5 5, 6 6 6 6 6 6]
- 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() }
- Write a program in Java, Python and Lisp When the program first launches, there is a menu which allows the user to select one of the following five options: 1.) Add a guest 2.) Add a room 3.) Add a booking 4.) View bookings 5.) Quit The functionality of these options is as follows: 1.) When users add a guest they provide a name which is stored in some manner of array or list. Guests are assigned a unique ID value where the first guest added is assigned the ID value 1, the second guest added is assigned the ID value 2 and so on. 2.) When users add a room they provide a room number and a room capacity (i.e. how many people can stay in the room at any one time) which is stored in some manner of array or list. Rooms have a property which indicates if they are booked or not for any given date – please see the Room Booking Dates section below for some guidance on the easiest way to implement this. 3.) When users add a booking they provide a guest ID, room number, the number…You are going to create an autogenerated list of numbers. Ask a user for a random number between 1 and 25. Your program must create a list of numbers between 1 and the user-given number. BUT it should only include every second number. Display the list of numbers in a nicely formatted way. The numbers should be seperated by (",")(comma with no spaces)(notice the spaces on each side of the comma) If the user types 19 the program will print: 1 , 3 , 5 , 7 , 9 , 11 , 13 , 15 , 17 , 19 Use a For loop to answer this question. Do not write a function or procedure. Only write the code. The output must match the above and the test case output formatting. For example Input Result 15 Please enter a number between 1 and 25: 1,3,5,7,9,11,13,15 12 Please enter a number between 1 and 25: 1,3,5,7,9,11 8 Please enter a number between 1 and 25: 1,3,5,7Python programming. For this program, you need to write a function that processes a list, then tests the function with extreme values (min and max) Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f=p×(1+i)t• f is the future value of the account after the specified time period.• p is the present value of the account.• i is the monthly interest rate.• t is the number of months.Write a program that takes the account's present value, monthly interest rate, and the number of months that the money will be left in the account as three inputs from the user. The program should pass these values to a function that returns the future value of the account, after the specified number of months. The program should print the account's future value.