1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vilka [71]
4 years ago
9

Given that k and j each refer to a non-negative int and that play_list has been defined to be a list with at least j elements, w

rite an expression that evaluates to a new list containing all the elements from the one at index k through the one at index j-1 of list play_list . Do not modify play_list .
Computers and Technology
1 answer:
Vlada [557]4 years ago
6 0

Answer:

Following are the program in the Python Programming Language

#list type variable

play_list = [10,20,30,40,50,60,70,80]

k=3    #integer type variable

j=len(play_list)   #integer type variable

new_list=play_list[k:j]  #solution is here

print("play_list: ",play_list)   #print variable play_list

print("new_list:  ",new_list)    #print variable new_list

<u>Output</u>:

play_list:  [10, 20, 30, 40, 50, 60, 70, 80]

new_list:   [40, 50, 60, 70, 80]

Explanation:

Here, we set the list type variable "play_list" and assign elements in it is  [10,20,30,40,50,60,70,80]  then, we set an integer type variable "k" and assign value is 3.

  • Then, we set an integer type variable "j" and assign the length of the variable "play_list" in it.
  • Then, set the list type variable "new_list" and assign the elements of the variable "play_list" after applying slicing on it.
  • Finally, print the variable "play_list" and the variable "new_list".
You might be interested in
Suppose you want to view a document that has several headings. what view would you use?
bija089 [108]
Um i think outline. :)
5 0
3 years ago
if the bandwidth-delay product of a channel is 500 Mbps and 1 bit takes 25 milliseconds to make the roundtrip, what is the bandw
Leona [35]

Answer:

2500 kb

Explanation:

Here, we are to calculate the bandwidth delay product

From the question, we are given that

band width = 500 Mbps

The bandwidth-delay product is = 500 x 10^6 x 25 x 10^-3

= 2500 Kbits

8 0
3 years ago
The right of workers to seek safety and health on the job without fear of punishment is spelled out in:
mr Goodwill [35]
The answer to the question is C.
3 0
4 years ago
The following checksum formula is widely used by banks and credit card companies to validate legal account numbers: d0 + f(d1) +
Aleksandr [31]

Answer:

Here is the JAVA program:

import java.util.Scanner; //to import Scanner class

public class ISBN

{   public static void main(String[] args)  { // start of main() function body

   Scanner s = new Scanner(System.in); // creates Scanner object

//prompts the user to enter 10 digit integer

   System.out.println("Enter the digits of an ISBN as integer: ");    

   String number = s.next(); // reads the number from the user

   int sum = 0; // stores the sum of the digits

   for (int i = 2; i <= number.length(); i++) {

//loop starts and continues till the end of the number is reached by i

          sum += (i * number.charAt(i - 1) ); }

/*this statement multiplies each digit of the number with i and adds the value of sum to the product result and stores in the sum variable*/

          int remainder = (sum % 11);  // take mod of sum by 11 to get checksum  

   if (remainder == 10)

/*if remainder is equal to 10 adds X at the end of given isbn number as checksum value */

  { System.out.println("The ISBN number is " + number + "X"); }

  else

// displays input number with the checksum value computed

 {System.out.println("The ISBN number is " + number + remainder); }  }  }  

Explanation:

This program takes a 10-digit integer as a command line argument and uses Scanner class to accept input from the user.

The for loop has a variable i that starts from 2 and the loop terminates when the value of i exceeds 10 and this loop multiplies each digit of the input number with the i and this product is added and stored in variable sum. charAt() function is used to return a char value at i-1.

This is done in the following way: suppose d represents each digit:

sum=d1 * 1 + d2 * 2 + d3 * 3 + d4 * 4 + d5 * 5 + d6 * 6 + d7 * 7 + d8 * 8 + d9 * 9

Next the mod operator is used to get the remainder by dividing the value of sum with 11 in order to find the checksum and stores the result in remainder variable.

If the value of remainder is equal to 10 then use X for 10 and the output will be the 10 digits and the 11th digit checksum (last digit) is X.

If the value of remainder is not equal to 10, then it prints a valid 11-digit number with the given integer as its first 10 digits and the checksum computed by sum % 11 as the last digit.  

8 0
3 years ago
charles, a security analyst, needs to check his network for vulnerabilities. he wants a scan that interacts with network nodes a
finlep [7]

Charles, a security analyst, needs to check his network for vulnerabilities. he wants a scan that interacts with network nodes and repairs security issues found. The kind of scanning that best describes Charles's requirements is: Active scanning.

<h3>Who is a Security Analyst?</h3>

A Security Analyst's responsibilities include the following:

Define, plan, execute, maintain, and improve security measures, policies, and controls. Writing reports and offering insights on the effectiveness of current security policies, incident response plans, disaster recovery plans, and other security-related information

Active scanning is a scanning approach that involves scanning individual endpoints in an IT network in order to retrieve more specific information.

Learn more about Security Analysts:
brainly.com/question/16354463
#SPJ1

6 0
1 year ago
Other questions:
  • Which is an unethical use of technology and resources at the workplace?
    13·2 answers
  • What’s the best description of an opportunity cost
    5·1 answer
  • C++ Question (if and while loops)
    7·1 answer
  • #Write a function called hide_and_seek. The function should #have no parameters and return no value; instead, when #called, it s
    7·1 answer
  • What is a special type of variable used in subroutines that refers to a piece of data?
    15·1 answer
  • Which online article citation is correctly formatted according to MLA standards?
    15·2 answers
  • Bao bì chủ động active packaging và bao bì thông minh intelligent packaging khác biệt như thế nào
    15·1 answer
  • What product use programmable control?
    11·1 answer
  • A user generates printouts consisting of several pages of seemingly random characters every time he prints to a network printer.
    5·1 answer
  • How do I make my header line visible?
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!