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
The piece of hardware that contains the circuitry that processes the information coming in to the computer and tells the other h
Gemiola [76]

The answer is C. Central processing unit (or CPU).

The trick is in the name, central processing unit :)

3 0
3 years ago
. When a function template has two parameterized types, one as the return value, and one as an argument, then _____.
mart [117]

When a function template has two parameterized types, one as the return value, and one as an argument, then THE FIRST TIME MUST BE EXPLICITLY CODED.

Explanation:

  • The act of implicit and explicit coding, and implicit and explicit code, is defined by context of execution of additional behavior or type setting/casting. Specifically, implicit or explicit methods are defined by the contexts in which they are meant to be used.
  • The explicit coding discipline favors clear and explicit expression of intent in the code.
  • The uses-cases dictate the structure of the application. What the application does should not be implicitly hidden in an organization that the framework is trying to dictate you. Avoid having folders like /controllers, /views at the highest level of folders organization, in favor of folders containing features and use-cases: /categories, /products, etc.
  • Template parameter represents a type that has not yet been specified, but that can be used in the template function as if it were a regular type.

4 0
3 years ago
. Gathering information with your eyes is called __________.
vovikov84 [41]
D. Visual Perception
4 0
2 years ago
What are the basic data types supported in C programing language?
Murljashka [212]

Answer:

The C language provides the four basic arithmetic type specifiers char, int, float and double, and the modifiers signed, unsigned, short, and long.

6 0
2 years ago
Alright, so im currently trying to pass a computer science class. i need it done in a little under 2 weeks. Ill just ask the one
Alla [95]

Answer:

B. Mesh

Explanation:

5 0
2 years ago
Other questions:
  • Ou have just set up a network that will use the tcp/ip protocol, and you want client computers to obtain ip configuration automa
    9·1 answer
  • Which file extension indicates that a file is an Adobe Acrobat document?
    13·1 answer
  • Someone asks you for help with a computer that hangs at odd times. You turn it on and work for about 15 minutes, and then the co
    7·1 answer
  • / Looks up author of selected books
    15·1 answer
  • Write an algorithm that accepts two numbers,
    7·1 answer
  • An array, numbers, of integers is filled with 100 random numbers whose values are greater than 10 and less than 255. You DO NOT
    7·1 answer
  • What means the data is still saved even if you turn the computer off or unplug it?​
    5·1 answer
  • 2. The<br>is the main and usually largest data storage hardware device in a computer​
    9·1 answer
  • What is the sequence of instructions performed to execute one program instruction
    13·1 answer
  • Your motherboard has sockets for 184-pin dimm ram. which type of ram should you install?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!