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
fiasKO [112]
4 years ago
7

What must you use to create a multi-line string?

Computers and Technology
1 answer:
IrinaK [193]4 years ago
7 0

Answer:

A single pair of three consecutive double quotation marks.

Explanation:

In Python, a multi-line string can be created by enclosing it in three double quotation marks. For example:

string = """This is a Python multi-line string

This is used to print string in multiple lines

This uses three consecutive quotation marks"""

print(string)

Output:

This is a Python multi-line string

This is used to print string in multiple lines

This uses three consecutive quotation marks

In addition to using three double quotation marks, \n and brackets ( ) are also used to create multi-line string in Python.

You might be interested in
Add a throw statement to the processNumbers function that throws the message "All elements in the list should be numbers." if on
Tju [1.3M]

Answer:

  1. function processNumbers(numList){
  2.    try{    
  3.        for(let i=0; i < numList.length; i++){
  4.            if(isNaN(numList[i])){
  5.                throw "All elements in the list should be numbers.";
  6.            }
  7.            
  8.        }
  9.    }
  10.    catch(err){
  11.        console.log(err);
  12.    }
  13. }
  14. let myList = [4, 6, 1, "abc", 9];
  15. processNumbers(myList);

Explanation:

The solution code is written in JavaScript as the isNaN() is an in-built function in JavaScript.

Firstly, create a function processNumbers that takes one input number list, numList (Line 1).

To handle the possible Not a Number (NaN) error, create a try and catch block. In the try block, create a for-loop to traverse through the numList array and use isNaN function to check if the current value is a number (Line 3 - 4). If it is not a number, isNaN will return true and the program will run the throw statement (Line 5). The throw message will be passed to the catch block and display it on console (Line 10 - 12).

We can test the function by using the sample list (Line 15 - 16) and we shall see the thrown error message is displayed.  

5 0
3 years ago
Why do i get message notifications but when i click on it it says i have no new messages?
jeka57 [31]

Answer:

Might just be a glitch you should try to ignore it for the time being or you can log out then log in to your acc

Explanation:

good luck

4 0
3 years ago
Here's another question!<br><br> What is some iterative programming structure uses?
inn [45]

Answer

Often in an algorithm, a group of statements needs to be executed again and again until a certain condition is met, this is where we find the need for iteration.

The repeated execution of some groups of code statements in a program is called iteration.

In iteration control structures, a statement or block is executed until the program reaches a certain state, or operations have been applied to every element of a collection. This is usually expressed with keywords such as while, repeat, for, or do..until.

The basic attribute of an iteration control structure is to be able to repeat some lines of code. The visual display of iteration creates a circular loop pattern when flowcharted, thus the word “loop” is associated with iteration control structures. Iteration can be accomplished with test before loops, test after loops, and counting loops. A question using Boolean concepts usually controls how often the loop will execute.

Applications of Iteration

Iteration methodology has various applications in the programming world

  • Problem-solving in arrays, vectors, lists, strings, etc.
  • Problem-solving using Stack, Queue and Priority Queue
  • Bottom-up implementation of Dynamic Programming
  • Implementation of greedy algorithms
  • BFS traversal of tree and graph
  • Problem-solving using Hash Table and BST
  • Iterative Implementation of recursive code using stack

Iteration (Repetition) Control Structures

pseudocode: While

count assigned zero

While count < 5

   Display "I love computers!"

   Increment count

End

pseudocode: Do While

count assigned five

Do

   Display "Blast off is soon!"

   Decrement count

While count > zero

pseudocode: Repeat Until

count assigned five

Repeat

   Display "Blast off is soon!"

   Decrement count

Until count < one

pseudocode: For

For x starts at 0, x < 5, increment x

   Display "Are we having fun?"

End

7 0
3 years ago
Solve the equation.<br>| 11 X 12362​
sergey [27]

Answer:

135982

Explanation:

Its simple math

4 0
3 years ago
What motivated Barbara MBANEFO to become an engineer?
luda_lava [24]

Answer:

to help her community and give hope to others

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • How many results are shown by default when using a Top or Rare Command?
    13·1 answer
  • What is the difference between a router and a modem
    15·1 answer
  • Alburry and wagga wagga are 130km apart. How many centimeters apart are they on a map with a scale factor of 1:250000?​
    13·1 answer
  • You will be administratively suspended if you have a breath or blood alcohol level of.... or above or refuse to submit to a chem
    12·1 answer
  • Which of the following tasks would you most likely use a spreadsheet to complete
    15·1 answer
  • Want summmmmmmm bec i do lol
    9·1 answer
  • The ____________ deals with the well-being of the EMT, career progression, and EMT compensation. Select one: A. EMS administrato
    9·1 answer
  • Which tool determines whether or not applications, devices, and computers will work with a new operating system, while maintaini
    13·1 answer
  • Write a technical term for following statements
    15·1 answer
  • List three variables that could be used in creating a model that determines the best day to plant corn in a given location. 30 p
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!