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]
3 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]3 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
Iglesias intends to use a word processing program to create a web page. Which of these options should Iglesias use?
Murrr4er [49]
He should view the Outline THEN the Layout and finally preview in web browser.
6 0
3 years ago
Which of the following are actions a programmer could take when debugging a segment of code that would most likely lead to findi
Verizon [17]

Answer:

Option B and C are the correct answer for the above question

Explanation:

The above question asked about the work of the programmer to catch an error of the program--

  • Then the option B states that the programmer needs to prints the value of the various program variable on every line of the program which is the correct solution because it is used to find the error easily. It defines the value of every variable in every place of the program and the programmer caught the error statement in the program if anywhere the variable gets the false value.
  • The C option states to help from a friend, it is also a good solution because the friend can easily be caught the error of the program by seeing every line of code.
  • But the other option is not correct because the option A states that the change the name of the variable which is not a result of anything.
  • And the option D states that the code will be retyped again which is also not justify anything.

6 0
2 years ago
Match the fallacy with its name. Being a speaker of Spanish, I'm also great at speaking Italian.
tresset_1 [31]
Straw man
eg. "Senator Jones says that we should not fund the attack submarine program. I disagree entirely. I can't understand why he wants to leave us defenseless like that."

Ad hominem
eg. “How can you argue your case for vegetarianism when you are enjoying your steak?”

Over simplication
eg. President Bush wants our country to trade with Fidel Castro's Communist Cuba. I say there should be a trade embargo against Cuba. The issue in our election is Cuban trade, and if you are against it, then you should vote for me for president.

Bandwagon
eg. Everyone is selfish; everyone is doing what he believes will make himself happier. The recognition of that can take most of the sting out of accusations that you're being "selfish." Why should you feel guilty for seeking your own happiness when that's what everyone else is doing, too?

Black or white
eg. Well, it's time for a decision. Will you contribute $20 to our environmental fund, or are you on the side of environmental destruction?
3 0
3 years ago
What is HTML ? <br>Give a small description about html
Genrish500 [490]
Hypertext Markup Language, a standardized system for tagging text files to achieve font, colour, graphic, and hyperlink effects on World Wide Web pages.
this information was taken from google
7 0
2 years ago
Read 2 more answers
While many instruments have been "electrified", there is no such thing for the drums.
coldgirl [10]
False, because they are called percussion group
4 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following can you NOT apply for at any FLHSMV office? A. Certificate of title B. License plates C. Vehicle registra
    15·2 answers
  • A restaurant is a workplace for someone whose career specialty is in
    14·2 answers
  • Jeffrey works with a huge database of spreadsheet records each day. To organize and identify these spreadsheets, he wants to ass
    8·1 answer
  • Design an algorithm for finding all the factors of a positive integer. For example, in the case of the integer 12, your algorith
    8·1 answer
  • In which of the following situations should you expect to provide your Social Security number?
    13·1 answer
  • 2. Write a Python regular expression to replace all white space with # in given string “Python is very simple programming langua
    14·1 answer
  • Software que busca, detecta y elimina malware tipo espía; puede instalarse en la computadora de manera aislada o en conjunto con
    11·1 answer
  • Anyone trying to play fortnite ? im bored lol
    6·2 answers
  • Please i relly need this! ​
    11·1 answer
  • Write a function magicCheck that takes a one-dimensional array of size 16, a two-dimensional array of four rows and four columns
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!