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
Does an android tablet have a hard drive
Kisachek [45]
No, it uses flash menory
3 0
4 years ago
Which organization or agency would assist the fire department with incident scene security, crowd control, and explosives dispos
Sav [38]

The organization or agency would assist the fire department with incident scene security, crowd control, and explosives disposal is law <u>enforcement</u>.

<h3>What is Law enforcement?</h3>

Law enforcement is said to be activity of a given members of government and they are said to often act in an organized manner to enforce law by knowing , deterring people who violate the rules and regulations that are governing that society.

hence, The organization or agency would assist the fire department with incident scene security, crowd control, and explosives disposal is law <u>enforcement</u>.

Learn more about law enforcement from

brainly.com/question/21082629

#SPJ1

8 0
2 years ago
Janice has decided that the best approach to programming a new social media app is to start with a small portion of it by writin
Maru [420]

Answer:

blacc

bhhj

Explanation:

4 0
3 years ago
.حدد/ي الكيانات في النظام
olasank [31]

Answer:

what

Explanation:

6 0
3 years ago
Read 2 more answers
Don't Answer If You Are Going To Give Me a Link! DON'T WASTE MY POINTS!
dimulka [17.4K]

Answer:

B but don't be surprised if it is not the answer given.  It's just the best of a bunch of poor choices.

Explanation:

This is actually not an easy question to answer. It's one of those answers that has elements of "Some do and Some don't" in them.

A:  is not true for painters and it is not necessarily true for C for painters.

D: photographer can pose his subjects. A painter can pose someone, but not always.

C: Answered under A.

I think the answer you are forced to choose is B, but neither one has to do it. Still life painters ( a bowl of fruit, a bouquet of flowers) and photographs pose the subjects carefully and do not want the fruit or flowers to move around.

I'd pick B, but it does not have to be the answer. I just think it is less wrong than the others.

5 0
3 years ago
Other questions:
  • Why would you want to minimize the Ribbon?
    11·1 answer
  • Gateway drugs are normally not addictive
    15·2 answers
  • Technician A says that automotive engine blocks are usually classified by the number of cylinders the block. Technician B says t
    9·1 answer
  • Which feature enables you to make changes to all the slides of your presentation at the same time?
    15·2 answers
  • Write a calculator program that keeps track of a subtotal like real calculators do. Start by asking the user for an initial numb
    12·1 answer
  • Yall rachits and yall eat butt xD
    10·2 answers
  • Identify the benefit of modeling to communicate a solution.
    10·1 answer
  • What is the purpose of the new window command
    6·1 answer
  • The overall cost of wiring in addressable fire alarm system is significantly cheaper than the conventional one. Why is it so?
    14·1 answer
  • A ________ is a device used to illegally capture the data stored on the magnetic stripe of an ATM card, credit card, or debit ca
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!