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
saveliy_v [14]
3 years ago
12

Assume that sentence is a variable that has been associated with a string consisting of words separated by single space characte

rs with a period at the end. for example: "this is a possible value of sentence." write the statements needed so that the variable secondword is associated with the second word of the value of sentence . so, if the value of sentence were "broccoli is delicious." your code would associate secondword with the value "is" .
Computers and Technology
2 answers:
Morgarella [4.7K]3 years ago
6 0

Answer:

The solution code is written in Python.

  1. text  = "broccoli is delicious."
  2. wordList = text.split(" ")
  3. secondword = wordList [1]

Explanation:

Firstly, let us declare a variable text and assign it with a string (Line 1).

Next, we can use the split() method and use single space character " " as the delimiter to separate the words in the string by turning it into a word list (e.g. ["broccoli",  "is", "delicious."]) (Line 2)

We can use the index 1 to address the second word from the wordList and then associate it with variable secondword (Line 3).

sleet_krkn [62]3 years ago
3 0

The right code is,

secondWord = sentence.substr (sentence.find ("`") + 1);

secondWord = secondWord.substr (0, secondWord.find ("`"));

You might be interested in
An identifier that is prefixed with an @ and allows you to use code written in other languages that do not have the same set of
Nina [5.8K]

Answer:

Verbatim Identifier

Explanation:

  • Verbatim Identifier contains @ symbol as a prefix by which enables you to use reserved words of a programming language as identifier. For example the keywords like int, double, goto, char, else, while, for, float etc can be used as strings or variable names if @ symbol is added before these words e.g. @char, @while, @void, @int etc.
  • The compiler of a language will recognize such identifiers as verbatim identifiers and compiles them without giving an error that these are reserved words.
  • Verbatim identifier is used for program that is written in other languages and those languages don't have same reserved words.
  • For example: cout<<"use of verbatim identifier";<<@for;   In this statement, for keyword which is used in for loop can be used as an identifier with @ in the prefix.
  • The escape sequences if used with @ symbol in prefix then they are interpreted in a different way. For example in C#

                              string a = "\\C:\torrent\new\file";

                              Console.WriteLine(a);

This statement will give the following output:

                              \C:          orrent

                               ewfile

This means that the \t in the start of torrent and \n in the start of new word is taken as an escape sequence and output displayed is giving tab space because of \t and prints the rest of the words in new line because of \n escape sequence.

Now lets use this with the @ symbol

                               string a = @"\\C:\torrent\new\file";

                                Console.WriteLine(a);

The output will now be:

                                \\C:\torrent\new\file

\t and \n are not taken as escape sequences by the compiler because of @ symbol.

4 0
3 years ago
)How to extract a specific element of item in a list?
pogonyaev

Answer:

List items are usually accessed using the indexing operator.

Explanation:

Depends on the language, and what you mean with extracting? Do you mean accessing or removing?

3 0
3 years ago
What was the best Metal Gear Solid you enjoyed the most?​
kenny6666 [7]

My personal favorite is Metal gear solid 3: <em>Snake eater</em>.

7 0
3 years ago
What steps can be used to password-protect a worksheet?
muminat

Answer:

Review

Changes

Protect sheet

Explanation:

I did it

8 0
3 years ago
A technically qualified individual who may configure firewalls and IDPSs, implement security software, diagnose and troubleshoot
sineoko [7]

Answer:

Security technician

Explanation:

Security technicians are responsible for fixing, planning, and implementing the IT and computer security system of organisations by making sure the safety and security of the data and information of the clients as well as the employees that make daily use of the systems

Security technicians administer security access to the clients and employees of the organization and are responsible for being up to date with the latest IT security technology developments.

7 0
3 years ago
Other questions:
  • When you are printing handouts, which of these can you do? A. Save paper by placing more than one slide per page. B. Check the f
    7·1 answer
  • Ada lovelace designed the first computer
    7·1 answer
  • Description A data retrieval tool that finds specified data within a database A collection of records All of the fields for a si
    7·1 answer
  • What is the difference between an electronic notebook and electronic flash cards?
    8·1 answer
  • Write a function called simulate_several_key_strikes. It should take one argument: an integer specifying the number of key strik
    7·1 answer
  • How do you copy and paste plz let me know
    14·2 answers
  • How can I make a website login system with only using php?​
    6·1 answer
  • 1. Which sentence best expresses the main idea
    12·1 answer
  • FREEEEE 100 POINTS COME TAKE COME COME COME<br><br> only if u like da black panther
    8·2 answers
  • Consider the following code using the posix pthreads api:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!