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
Complex communication skills will probably never be outsourced to a computer because they require the human touch.
frutty [35]
True because eventually a human needs to repair the computers
4 0
4 years ago
Por qué el entorno gráfico de Windows es amigable con el hombre ?
elena-14-01-66 [18.8K]

Explanation:

Por que es un sistema diseñado para ayudar a las personas de forma amable

ESPERO Y TE AYUDE ;)

3 0
3 years ago
What does VERONIcA stand for?
kompoz [17]
Very Easy Rodent-Oriented Netwide Index to Computerized Archives
5 0
4 years ago
Read 2 more answers
Who invent cars and who invent bikes and who invent pc
julia-pushkina [17]

Answer:

  • Cars were invented in 1886 by Karl Benz.
  • The term bicycle was coined in France in the 1860s, but The first verifiable claim for a practically used bicycle belongs to German Baron Karl von Drais in 1817
  • The first computer was by Charles Babbage, an English mechanical engineer and polymath he originated the concept of a programmable computer.

7 0
3 years ago
What are the advantages of upgrading computer hardware?
babymother [125]
Depends What type of Hardware you are talking about there it depends what you upgrade in a computer for example if you upgrade your ram it make it run and preform faster.
5 0
4 years ago
Read 2 more answers
Other questions:
  • A ________ is a small text file passed to a web browser on a user's computer by a web server.
    7·1 answer
  • Which is the MOST efficient means of disentangling passengers from a wrecked​ vehicle? A. Remove the steering wheel and column.
    10·1 answer
  • Critics of media consumption
    10·2 answers
  • _____ is a software delivery approach in which an organization outsources the equipment used to support its data processing oper
    5·1 answer
  • For LG, on the app Messages, will the delete button on the upper right corner cancel a sending message?
    12·1 answer
  • Why is this cite so rigged
    10·1 answer
  • In many multiprocessor systems __________ is used rather than dedicated processor assignment; in order to evenly distribute work
    14·1 answer
  • After inserting a video into your slide how can you test it
    11·1 answer
  • Answer pls pls pls pls ​
    13·1 answer
  • (2 points) starting from the root node, we want to populate a bst with the keys in a given list without altering the key order.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!