Can someone please tell, me whats wrong with this code....its supposed to give the fibonacci sequence as output but its giving 0 as output instead​

Can Someone Please Tell, Me Whats Wrong With This Code....its Supposed To Give The Fibonacci Sequence

Answers

Answer 1

def series(n):

   n1 = 0

   n2 = 1

   count = 0

   if n <=0:

       print("Please enter a positive integer")

   if count ==0:

       print(0)

       print(1)

       count +=2

   while count < n:

       nth = n1 + n2

       n1 = n2

       n2 = nth

       count += 1

       print(nth)

series(7)

I've written the working code. You added a break statement which right under a print function, which only printed the value of n1 and by looking at your variables, n1 = 0. That's why it was only printing 0.


Related Questions

Why do the spelling and grammar checkers in Word miss some errors?
Answer must include 3-5 sentences

Answers

Answer:

Word dose not always catch misspellings why? Its because its a computer program. the program has to run through algorithms (millions a second) and that makes a large margin for error. it  could also be the fact that the misspelling is very uncommon so it dose not recognize it.  

Explanation:

How long do batteries on your mobile computer last before they can no longer hold a charge?

Answers

I am not sure ask google

If your company increases its market penetration, what is happening?
A.
The target market is growing.
B.
More people in the target market are buying the company's product.
C.
The market saturation of the target market has decreased.
D.
Competitors who offer similar products are entering the market.
D.
Your company collects credit card information from customers.

Answers

Answer:   (A, B, E)

A. ) The target market is growing.

B. ) More people in the target market are buying the company's product.

E. ) Your company collects credit card information from customers.

Explanation:  Simply what was on the assignment. Correct on Edge.

I hope this helped!

Good luck <3

Answer:

a,b,e like  the top one said

Explanation:

this is late but thats okay

A draft has the following:
Plot
Details
Transition Words
Important events in order

Answers

What do you have to do?

An office uses an application to assign work to its staff members. The application uses a binary sequence to represent each of 100 staff members. What is the minimum number of bits needed to assign a unique bit sequence to each staff member?
A 5
B 6
C 7
D 8

Answers

Answer: I believe the answer is: A, 5.

Explanation:

The minimum number of bits required to assign a unique bit sequence is 7.

Binary numbers are represented as 0's and 1's

Let n = number of bits [tex] {2}^{n} = required \: sequence[/tex]

Therefore,

[tex] {2}^{n} \geqslant 100[/tex]

The whole number value of n, which is greater than or equal to 100;

[tex] {2}^{7} = 128[/tex]

The value of n which satisfies the inequality is 7

Therefore, the minimum number of bits required is 7.

Learn more : https://brainly.com/question/20865548?referrer=searchResults

WILL GIVE BRAINLIEST!!!!!!!
In a series circuit, electricity flows along more than one path.


True

False

Answers

The answer is True !!!!!!!!!!!!!!!

Which view is the default for contacts in Outlook 2016?
OBusiness Card
O Card
O Phone
O People

Answers

Answer:

people

Explanation:

Answer:

people

Explanation:

I got it right on the test

PLEASE HELP ASAP!!!!!!!






Is this statement true or false?

You can apply only one of these at a time: underline, bold, or italics.


true

false

Answers

Answer:

i am pretty sure that is false

Explanation:

Coding question. Please help me?

Answers

Answer:

a  for a loop

Explanation:

how are images encoded?
( don’t copy and paste please)

Answers

Answer:

Images are encoded using binary arrays. Where each Pixel is, an array of RGBA, Red, Green, Blue and Alpha is used to represent that pixels color. Now put that on a screen of 1920x1080, you have to do that 2,073,600 times to get a full image, of which all values are filled.

Explanation:

Digital images are encoded in binary. We can make connections between the amount of data used by the computer to store, transmit and create an image and the file size of different images , the more pixels and more bits to encode the image, the larger the file size
Stay safe !
Please mark me as brainliest

Which data type is 1.2e3?

string

single

int

float

Just basic Python coding BTW :L

Answers

Answer:

Float, Floating point numbers go up to 3.402823466 E + 38

Explanation:

Micheal is the project manager in a company. He wants his organization to use technology for higher revenue and productivity. What should Micheals company do?

Answers

Answer:

For higher revenue, the mamagement of income, discounts and all financial matters whereby the use of technology can help by installing a

BUSINESS APPLICATION

Use the table and the drop-down menus to order the
steps.
Click on the New tab.
Click on the Save or Save As tab.ha
Click on the Blank workbook image.
Type data into the columns and rows.
Create file name and choose location of file.

Answers

Answer: 2, 6, 3, 4, 7

Explanation:

Answer:

2

6

3

4

7

Explanation:

What is a good way to become a game developer without spending a lot of money?

Answers

Answer:

Codes

Explanation:

learn the codes first. when you're already expert, you'll find ways from there.

If you need to modify a features in a part created using the Mirror tool, you can make the change in the original feature and the feature on the other side of the mirror plane will be modified automatically.
Select Answer

False

True

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The correct answer to this question is TRUE.

Because when you are designing something and drawing anything and it is symmetric in shape and half of the part is created, then if you use mirror features, then the other half part will get created automatically.

If you need to modify the features in the original part of the drawing or design then the other side of the mirror plane will be modified automatically.

Because whatever you will make changes in the original part of the design, then the other part that is created by using mirror features will get modified automatically.  

What is the output of this program?

numA = 2
numB = 3
if numA == 2 or numB == 2:
print("yes")
elif numA == 2 and numB == 3:
print("no")
Output:

Answers

The output of this program would be letter b (numB=3) because square 2 equals 82 squares and then you get three

Answer:

out is no

Explanation:

just took the quiz

Help, please! I will mark as brainliest

Answers

Answer:

Change line 7 to:

for( int i=0; i < names.length; i++)

Last element in the array is one less than the length, ie:

stArr1.length - 1

To print every other value, you replace index++ with index += 2

Explanation:

Not only should you change the <= into <, but also i should start at 0, not 1. The first element of an array has index 0.

How many 1000-Watt lights can be plugged into a standard 120-Volt, 15-Amp outlet? (Hint: W/V=A) *

Answers

Answer:

There are up to 12 lights and or plugs on that circuit. A 1000w HPS or Metal Halide light takes 9 amps at 120 volts so you can only run one on a wall outlet circuit. A standard dryer outlet is 220 volts and 30 amps so you can power up to six 1000 watt lights on that circuit.

Who got social media that is smart in English subject a lot pass it here your social media pls?

Answers

Answer:

I'll help with work for a low price HMU

_kay.sanchez_ Instagram

The position of a runner in a race is a type of analog data. The runner’s position is tracked using sensors. Which of the following best describes how the position of the runner is represented digitally?
A
The position of the runner is determined by calculating the time difference between the start and the end of the race and making an estimation based on the runner’s average speed.
B
The position of the runner is measured and rounded to either 0 or 1 depending on whether the runner is closer to the starting line or closer to the finish line.
C
The position of the runner is predicted using a model based on performance data captured from previous races.
D
The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

Answers

Answer:

D. The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

Explanation:

C was wrong for me :(

Introduction:

The runner position is detected by sensors in a race. It is very difficult to keep track of every racer position manually therefore computer program are used to keep exact recordings.

Explanation:

The data is sometimes recorded manually and is in analog form which is converted in to digital form.

Conclusion:

The correct answer is D. The position of the runner is sampled at regular intervals to approximate the real-word position, and a sequence of bits is used to represent each sample.

Learn more at https://brainly.com/question/24577222

HELP ASAP PLEASE!

What is the output?
if (x == 1):
print ("ONE")
else:
print ("TWO")

Answers

Answer:

50

Explanation:

Compared with other PC operating systems, the
Apple OS:
A. is less secure
B. has fewer available applications
C. is typically only available on Apple hardware.
D. costs much less.

Answers

Answer:

C. Is typically only available on Apple hardware.

Explanation:

Answer:

c

Explanation:

A student entering high school is pursuing STEM education. What can you infer about this student?

Answers

Answer: according to my calculations, we can infer that the student is pursuing a STEM education

Explanation:

Answer:

he likes Science, technology, engineering, and mathematics

Explanation: beacause it makes sense

How many of the colonists of Jamestown died before they made it to shore, due to the difficult voyage?

half
almost all
one third
nonE

Answers

Almost all of the colonist of Jamestown died before they made it to shore, due to the difficult voyage.

True or False: You cannot flip the alignment of a mate while editing a mate.

Answers

It will be False because it can’t flip

Please help with this coding question

Answers

Answer: the variable called errors is tested to see if it is less than it equal to 4
Answer the third one

Calculate and express your answer in decimal form.

12⋅17
34⋅200
(0.2)⋅40
(0.25)⋅60

Answers

Answer:

ポイントが欲しいだけなのかわからない

Explanation:

何語を話していますか

if a friend asked you to help her decide what internal sabling system to install in her new house, what kinds of questions wouls you ask her to do? why would you ask those questions?​

Answers

Answer:

Assuming you mean *cabling system*

you could ask:

- The architectural structure of the building, which houses for the cabling installation.

- The function of the cabling installation.

- The configuration of an already installed system (upgrades and retrofits).

others

- The cable and connection products.

- The types of equipment the cabling installation will support -- present and future.

- Customer requirement.

You listened to a song on your computer. Explain in 3-5 sentences if you used hardware or software.

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

When you have listened to music on your computer. You used both computer hardware and software. You used a hard drive as a hardware device that stored your song. And, software such as s media player that you used to play the song.    

I hope this answer helps you.

When a recipient responds to a meeting request, which statement most accurate descries what occurs?
O The meeting is confirmed, and the time is shown as Busy on the recipient's calendar.
O The meeting is confirmed, and the time is shown as Free on the recipient's calendar.
O The meeting request is removed from the inbox, the meeting is confirmed, and the time is shown as Busy on
the recipient's calendar.
O Nothing occurs because a recipient does not need to respond to a meeting request.

Answers

Answer:

I believe the answer is: O Nothing occurs because a recipient does not need to respond to a meeting request.

Explanation:

Well, it's true. I've got a response from a meeting request and it was irrelevant, so nothing would be happening.

Sorry for the delayed response, hope this helps :)

The meeting request is removed from the inbox, the meeting is confirmed, and the time is shown as Busy on the recipient's calendar. Thus, option C is correct.

What happens when one can request for meeting on Microsoft Outlook?

Upon acceptance of a meeting request on Microsoft Outlook, the schedule is added to your calendar, and the time period is displayed as busy, while the email invite is deleted from your email.

The following steps are required when it is desired to retain meeting requests and store them within the email or a subfolder for future references

1) Click on the Tools menu

2) Click on Options in the Tools Menu

3) Click E-mail Options in the Options menu

4) Click on Advanced E-mail Options  and

5) Uncheck the Delete meeting request from Inbox when responding.

The meeting request is removed from the inbox, the meeting is confirmed, and the time is shown as Busy on the recipient's calendar. Nothing occurs because a recipient does not need to respond to a meeting request.

Therefore, The meeting request is removed from the inbox, the meeting is confirmed, and the time is shown as Busy on the recipient's calendar. Thus, option C is correct.

Learn more about meeting request on:

https://brainly.com/question/2931702

#SPJ6

Other Questions
What is an insulator?O An object that transfers heat wellO An object that does not transfer heat wellO Part of the human bodyO Aliving organism Which statement best completes the table? Features of the Hindu Caste System Priests are at the top of society Servants are at the bottom of society ? O A. People cannot change their places in society. B. Religion plays no role in a person's social standing. O C. Warriors are not highly valued in society. D. Women are not given a place in society. Choose the correct contraction. Las plumas son _____ profesora.De lasDe laDelWill name brainliest How did DDE devices have made our daily life easier? Jeff can put shingles on a house in 9 hours while David can shingle the same house in 6 hours. If the two work together, how long would it take them to shingle the house?about 4 hours and 30 minutesabout 4 hoursabout 3 hours and 30 minutesabout 3 hours 2 3/9+3/7 fraction please answer fast Who here is amazing at math and is willing to help me every time I need help with math?! At a constant temperature, which of the gases will have the highest averagekinetic energy?A) H2B) N2C) O2D) F2E) All the gases will have the same averagekinetic energy. 1.Convert pounds to ounces.(1 pound = 16 ounces)14 pounds =(1 pound)=*(ounces)Ilounces Which statements correctly describe what happened during Qin's rule?Select all correct answers.A.The nobles moved to the imperial capital but continued to rule their districts.B. A standardized system of weights and measures was adopted.C.Officials standardized the writing characters to have the same meaning.D.Each state retained its own currency.E. A standard width was adopted for carts. Please, answer it correctly. Can someone plz help One question onlyI WILL CROWN BRAINLIEST What are common characteristics of jobs in the Recreation, Amusements, and Attractions pathway? Check all that apply. part-time travel-related self-employed entry-level food service cleaning service Which of the following BEST describes the domain of the relation graphed below. Factor 28xy + 25 + 35x + 20y when you cut an onion, what happens to your eyes? what role do you think the onions' central vacuoles have in your reaction? A global organization headquartered in London that represents over 200 consumer groups in more than 100 nations is called: Multiple Choice Consumers Union. Consumers International. Public Interest Research Group. Public Citizen. what is the full form of jcb How can we change the speed of a toy car on a racetrack to describe the cars motion? 4/4-x = 5/4+x what is x