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
pogonyaev
3 years ago
8

Python - Please help!

Computers and Technology
1 answer:
Margaret [11]3 years ago
6 0

Answer:

i= 1

for i in range(1,n):

     if i * i < n:

           print(2* i + 1)

     i += 1

else:

     print('Hakuna Matata')

Explanation:

First, there's a need to rewrite the code segment in your question (because of indentation)

<em>i= 1</em>

<em>while i*i < n:</em>

<em>      print(2* i + 1)</em>

<em>      i += 1</em>

<em>else:</em>

<em>      print('Hakuna Matata')</em>

<em />

The explanation of the equivalent of the above while loop is as follows

This line initializes i to 1

i= 1

This line iterates from 1 to n-1

for i in range(1,n):

This line checks if i * i is less than n

     if i * i < n:

The following line is executed if the above condition is satisfied; otherwise, nothing is done

           print(2* i + 1)

The value of i is incremented by 1 using this line

     i += 1

The following is executed at the end of the iteration

else:

     print('Hakuna Matata')

<em>Note: Assume any value of n, both programs display the same output</em>

You might be interested in
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
svlad2 [7]

Prison or juvenile detention of course, its a violation

4 0
3 years ago
Alison is entering text in a Word document. As she is entering data, where will the cursor move in relation to the text she is t
Vinil7 [7]

The cursor should move right but if not give me more information to correct my statement

6 0
3 years ago
What is the correct order of precedence of the mathematical operators?
LenaWriter [7]
A common technique for remembering the order<span> of </span>operations<span> is the abbreviation "PEMDAS", which is turned into the phrase "Please Excuse My Dear Aunt Sally". It stands for "Parentheses, Exponents, Multiplication and Division, and Addition and Subtraction".</span>
7 0
3 years ago
A network administrator was told by the Chief Information Officer (CIO) to set up a new office with a network that has redundanc
balandron [24]

Answer:

"Mesh topology" is the correct answer.

Explanation:

  • A mesh topology seems to be a network configuration where there has been an interconnection between each hardware and communications system. This topology configuration allows the distribution of many of these signals, although one of the connexons starts going down.
  • This topology needs to connect each destination to any other end destination, thus creating a completely pointless channel.
3 0
3 years ago
Cloud vendors that are hosting hardware, operating system, database, and other software, which clients can then use to build the
iren2701 [21]

Answer:

a. Software as a Service.

Explanation:

These Cloud vendors are said to be providing Software as a Service. This is because regardless of that the underlying specs are in regards to hardware, operating systems, database, etc. The vendor is selling a subscription to their cloud software which bundles all of these services together. Therefore, what they are ultimately providing is a Software that the individual can use as a service, and enjoy all of the included benefits/capabilities.

8 0
3 years ago
Other questions:
  • ***Help ***Which Paste Command is used to insert a new linked Excel worksheet into a PowerPoint presentation? A. Embed B. Use De
    7·1 answer
  • (01.05 LC)
    7·2 answers
  • What should be done if a system cannot boot from the hard drive?
    14·1 answer
  • What will be displayed if the following Java code segment is run? System.out.println("one "); System.out.print("two "); System.o
    12·1 answer
  • (03.05 LC
    14·1 answer
  • Outline four types of cyber law.
    14·1 answer
  • How is knowing how to use word or docs importamt?
    8·1 answer
  • Will economists be replaced by artificial intelligence?
    12·1 answer
  • Put these numbers in order from smallest to largest:<br> 1. 00101112<br> 2. 011110<br> 3. 011110112
    12·2 answers
  • A multiprocessor with 10 processors has 36 attached tape drives. A number of jobs have been submitted to the system where each j
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!