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
bekas [8.4K]
4 years ago
11

If my_string = "This is MY string!", why does print (my_string[0:7:5]) return "Ti" and not

Computers and Technology
1 answer:
notka56 [123]4 years ago
7 0

In Python, a string is an array of characters, we can access these characters using index operator []. For example, we have a_string = "Hello World" a_string[0] prints the first character in string ('H').

We can also use index operator to make substrings, for example a_string[0:3] will make a substring with first, second, third and fourth character equal to "Hell".

Now to business

my_string = "This is MY string!"

print(my_string[0:7]) # Prints "This is "

print(my_string[0:7:5]) # Prints "T" then prints the sixth character since we start counting at 0 hence prints "Ti" (note that space is also a character).

Hope this helps.

You might be interested in
Your boss wants to utilize some sort of cloud storage for his files so that all of his
Valentin [98]

Well, if he's using Google Drive or OneDrive it shows up in the main menu so My best guess would be Local Profile

4 0
4 years ago
Read 2 more answers
What is Telerobotic?
Dennis_Churaev [7]

Answer:

Telepresence refers to a set of technologies which allow a person to feel as if they were present, to give the appearance that they were present, or to have an effect, at a location other than their true location. Teleoperation is the operation of a machine at a distance.

Explanation:

4 0
3 years ago
Read 2 more answers
What is one reason the number of DUIs has dropped?
nikdorinn [45]

Answer:

Ride Sharing Services

Explanation:

Choosing to take Uber or have a designated driver instead of driving under the influence than have fewer students because fewer people are getting caught diving under the influence.

8 0
3 years ago
What are two best practices for discovering whether a message you’ve scheduled with Hootsuite has failed to send?
never [62]
I think:
<span>  C)  Regularly check Publisher's 'Rejected' Tab  <span>D)  Enable email notifications for failed messages under Preferences</span></span>

But I am not sure.
4 0
3 years ago
Read 2 more answers
Which of the following peripheral devices can be used for both input and output? mouse printer CPU touch screen on a tablet comp
LenaWriter [7]
Touch Screen, it provides both visual output and touch input.                                                
3 0
4 years ago
Read 2 more answers
Other questions:
  • To support an internet client, you must have six elements. the first three -- a computer, an operating system and tcp/ip -- are
    7·1 answer
  • What word processing feature saves you the most time when keying a document a. Thesaurus
    9·1 answer
  • According to the chart, which degree would you have to earn in order to make the most amount of money? A bar graph titled Averag
    13·2 answers
  • Which type of graph or chart measures
    15·2 answers
  • Does Marietta college have open admission
    12·1 answer
  • Which among the following choices is correct based on the two statements listed below? Statement 1: When the lexical analyzer sc
    12·1 answer
  • Saji was exploring the Themes menu for a presentation she just started working on. She found one she really liked, but wanted to
    8·1 answer
  • How does applying Fontworks effects to text on an advertising flyer change the text?
    14·2 answers
  • Different the need for external or secondary memory​
    12·1 answer
  • A major way the National Information Infrastructure Protection Act of 1996 amended the Computer Fraud and Abuse Act was the subs
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!