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
Which type of financial institution typically has membership requirements?
Anon25 [30]
Credit Union typically has membership requirements
8 0
3 years ago
A company accidentally sends a newsletter with a mistyped website address. The address points to a website that has been spoofed
Thepotemich [5.8K]

Answer:

Option (A) is the right answer.

Explanation:

The following terms can be described as :

Phishing: Phishing can be described as the concept of stealing personal data i.e. credit card, bank account information, etc. of customers by sending fraud emails or by making fraud webpages on the name of a reputed company.

Tailgating: tailgating can be defined as the concept of getting entry with the authorized person in a restricted zone.

Baiting: baiting can be described as the term of stealing personal data by giving greed to customers by telling them fraud offers.

Quid pro quo: quid pro quo can be defined as the concept where the attacker takes the access of the system.  

According to the scenario, the most appropriate answer is option (A) because the company sends a wrong web address which is used by hackers to collect user's personal data which comes under phishing.

3 0
3 years ago
Compare Fibonacci (recursion vs. bottom up)
ipn [44]

Answer:

C++ code explained below

Explanation:

#include<bits/stdc++.h>

#include <iostream>

using namespace std;

int FiboNR(int n)

{

int max=n+1;

int F[max];

F[0]=0;F[1]=1;

for(int i=2;i<=n;i++)

{

F[i]=F[i-1]+F[i-2];

}

return (F[n]);

}

int FiboR(int n)

{

if(n==0||n==1)

return n;

else

return (FiboR(n-1)+FiboR(n-2));

}

int main()

{

long long int i,f;

double t1,t2;

int n[]={1,5,10,15,20,25,30,35,40,45,50,55,60,65,70,75};

cout<<"Fibonacci time analysis ( recursive vs. non-recursive "<<endl;

cout<<"Integer FiboR(seconds) FiboNR(seconds) Fibo-value"<<endl;

for(i=0;i<16;i++)

{

clock_t begin = clock();

f=FiboR(n[i]);

clock_t end = clock();

t1=double(end-begin); // elapsed time in milli secons

begin = clock();

f=FiboNR(n[i]);

end = clock();

t2=double(end-begin);

cout<<n[i]<<" "<<t1*1.0/CLOCKS_PER_SEC <<" "<<t2*1.0/CLOCKS_PER_SEC <<" "<<f<<endl; //elapsed time in seconds

}

return 0;

}

7 0
3 years ago
Software piracy is acceptable as it helps us obtain software cheaper or sometimes even for free.
ELEN [110]

Answer: 1. False 2. True

Explanation: Piracy in any capacity is in fact illegal and might possibly be a felony I'm not quite sure. But it's just like stealing a toy from the store, somebody worked hard to make it and you best be paying for it.

Software licenses on the other hand usually give you permission to install the software on one or many machines depending on the license you purchase, but usually, if you paid for it once, you can use it anywhere.

8 0
3 years ago
Read 2 more answers
Explains why it is important to select the correct data when creating a chart
Liula [17]

Answer:

to be organized

Explanation:

<h2>because when you are organized to select the correct data, you won't confused </h2>
4 0
3 years ago
Other questions:
  • 4. The programmer who focuses on implementing the game mechanics, rules, and other elements essential for gameplay is the
    13·1 answer
  • Question: Can a single switch port handle two mac addresses?
    8·1 answer
  • Describe data center technology and its relevance to modern-day cloud computing
    14·1 answer
  • If you need to determine impacts on revenue resulting from an increase or
    15·1 answer
  • In c++
    12·1 answer
  • Use the drop-down menus to complete statements about options for inserting video files.
    15·1 answer
  • What are the different steps while solving a problem using computer? explain​
    7·1 answer
  • Write a programmer defined function that compares the ASCII sum of two strings. To compute the ASCII sum, you need to compute th
    6·1 answer
  • Module 1 and 2 Coding Guided Notes Fill in your answers to each response as you read through the lesson pages in the coding cour
    11·2 answers
  • A web application's code prevents the output of any type of information when an error occurs during a request. The development t
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!