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
A ___________ variable is declared outside all functions.
velikii [3]

Answer:

B. global

Explanation:

A global variable lives on even when a function returns.

7 0
3 years ago
There are ____ standard colors for text in a theme.
soldier1979 [14.2K]
In microsoft powerpoint there are 2 or two standard colors for text in a theme. If you use a theme on your presentation, a theme is always equipped with two types of colors for the text, because it gives you more options on what color suits your text and blends with the theme perfectly.
7 0
3 years ago
While a computer is running the operating system remains in memory. true or false?
MrMuchimi
While a computer is running the operating system remains in memory is true.
8 0
3 years ago
What is custom software
Kobotan [32]
A custom sofware is a computer program or website written <span>specifically for your company,</span>
4 0
3 years ago
Read 2 more answers
_____ is typically used to temporarily hold small units of program instructions and data immediately before, during, and after e
guapka [62]

Answer:

A register

Explanation:

Registers are small memory used to store data or values and supply them to the processor as and when needed. These register hold the data temporarily and hold small units of program instructions. So whenever the CPU wants to work on data they have to be made available through the registers. Even after a arithmetic operation the registers serve as buckets for holding the value.

There are different types of registers such as register A, B, C etc and these registers lie in close proximity to the CPU so that we could provide the data immediately and much faster when asked by the CPU.

Therefore we can say that registers are used to temporarily hold small units of program instructions and data immediately before, during, and after execution by the central processing unit (CPU).

8 0
2 years ago
Other questions:
  • What is a “spoof” of an ad ?
    8·2 answers
  • What type of survey can help a network administrator make decisions about bands, channels, and widths when installing new access
    9·1 answer
  • Does anyone know how to cancel a Pandora Free Trial Subscription? I need to cancel it by tomorrow. Please help!
    12·1 answer
  • To hide the ribbon, ______ on any one of the tabs of the ribbon.
    10·1 answer
  • In most software packages, the function key F1 is used to run the _____program.
    10·1 answer
  • You can combine the algorithms for converting between infix to postfix and for evaluating postfix to evaluate an infix expressio
    13·1 answer
  • Employees at the Red Bluff Golf Club &amp; Pro Shop have the opportunity to become certified trainers if they log enough hours.
    13·1 answer
  • A row in a table _____? for computer class and i’m in the middle of a test!
    14·1 answer
  • What are the qualities of different products that caught your eye and encourage you to buy them​
    12·1 answer
  • Please help thank u!!!!!
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!