answer.
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
adoni [48]
2 years ago
5

Imagine you have a 10-character string stored in the variable myString. You want to pull out the first five characters. Which of

the following lines of code would successfully generate a slice of the 10-character string holding only the first five characters?
a. myString[5]
b. myString[:-5]
c. myString[0:6]
d. myString-15:-5]
e. myString[0:10:2]
Computers and Technology
1 answer:
Andre45 [30]2 years ago
6 0

Answer:

b. myString[:-5]

d. myString[-15:-5]

Explanation:

I believe you have a typo in d. It must be d. myString[-15:-5]

Slicing can be done:

myString[starting_index, stopping_index, step] (step is optional). If you do not specify the starting index, it will start from the 0 as in b. If you write a range that is not in the range, as in d, Python will replace it with either 0 or length of the string (In this case, it is replaced with 0 because the starting index must be smaller than stopping index)

a. myString[5] → This will give you the sixth character

b. myString[:-5] → This will give you the first five characters

c. myString[0:6] → This will give you the first six characters

d. myString-15:-5] → This will give you the first five characters

e. myString[0:10:2] → This will give you the first, third, fifth, seventh, and ninth characters

You might be interested in
What are the arguments for writing efficient programs even though hardware is relatively inexpensive?
Ainat [17]

Answer: Even though the hardware is inexpensive the writing of program is not efficient through this method as proper development of program is necessary for the clear execution due to factors like:-

  • The facility of writing program even the cost of hardware is less but it is not a free facility.
  • It also has a slower processing for the execution of the program
  • The construction of the efficient program is necessary for the compilation and execution of it rather than poorly constructed program is worthless and inefficient in working.

7 0
2 years ago
Jason works as a financial investment advisor. He collects financial data from clients, processes the data online to calculate t
Ghella [55]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is an online decision support system. Because the decision support systems process the data, evaluate and predict the decision, and helps the decision-makers,  and offer real-time information immediately in making the decision in an organization. So the correct answer to this question is the decision supports system.

Why other options are not correct

Because the transaction processing system can only process the transaction and have not the capability to make the decision for the future. Office support processing system support office work, while the batch processing system process the task into the batch without user involvement.   however, online executive processing does not make decisions and offer timely information to decision-makers in an organization.

3 0
2 years ago
You buy a $3,500 car and finance it through the car dealer. the contract says if you are two months delinquent with your payment
photoshop1234 [79]
The car owner acquired his car because the car dealer offers him a financing credit services. It is part of the contract that the car owner should pay in monthly basis. It is a fact and part of the contract also that once the car owner failed to pay 2 months of his contribution, the car dealer will get his car back.
6 0
2 years ago
Lance is at a bus station. His friend is using the ATM machine to withdraw some money. Lance notices a stranger deceptively watc
Blababa [14]

Answer:

The person watching Lances friend typing the ATM pin is an example of <u>"shoulder browsing"</u> and Lances friend should <u>"Change the ATM pin."</u>

<u />

<u>I hope this is the answer you were looking for!</u>

8 0
2 years ago
Read 2 more answers
Consider a router that interconnects three subnets: subnet 1, subnet 2, and subnet 3. suppose all of the interfaces in each of t
creativ13 [48]

Answer:

thank God for us you and keep hoping tougher than I thought it would be

4 0
2 years ago
Read 2 more answers
Other questions:
  • Carlos owns a hardware store. He currently is not using any software to track what he has in the store. In one to two sentences,
    9·2 answers
  • Two career fields that lack minority professionals and thus offer many grant opportunities to students are education and _____.
    10·2 answers
  • ________ is used to undo unwanted database changes.
    15·2 answers
  • Is used to process certificates and private/public key information?
    12·1 answer
  • 7. Test Average and Grade Write a program that asks the user to enter five test scores. The program should display a letter grad
    15·1 answer
  • In a system containing CPU 1 and Disk Drive A, the system is instructed to access Track 1, Track 9, Track 1, and then Track 9 of
    12·1 answer
  • Big Data often involves a form of distributed storage and processing using Hadoop and MapReduce.
    12·1 answer
  • How would GIS, GPS, or remote sensing technology be used to evaluate the destruction caused by a tornado in Oklahoma?
    13·1 answer
  • Produce a list named prime_truths which contains True for prime numbers and False for nonprime numbers in the range [2,100]. We
    11·1 answer
  • ___________is used for drawing 3D objects in the field of Science and Engineering.
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!