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
Alex_Xolod [135]
4 years ago
10

Python: Write a program that asks the user how many Fibonnaci numbers to generate and then generates them.

Computers and Technology
1 answer:
Archy [21]4 years ago
7 0

Answer:

k (btw I kind of suck at python I use a lot of c++ but this is the best I can make up)

Explanation: def fibonacci():

   num = int(input("Please enter how many numbers would you like in your Fibonacci sequence: "))

   i = 1

   if num == 0:

       fib = []

   elif num == 1:

       fib = [1]

   elif num == 2:

       fib = [1,1]

   elif num > 2:

       fib = [1,1]

       while i < (num - 1):

           fib.append(fib[i] + fib[i-1])

           i += 1

   return fib

print (fibonacci())

input()

You might be interested in
Why do some people put salt on sidewalks when it snows?
drek231 [11]
It help to melt the snow quicker. they salt eats away the snow.
6 0
4 years ago
The first widely adopted windows product, ____, featured a standardized look and feel, similar to the one made popular by apple'
slega [8]
<span>The first widely adopted windows product, Windows 3, featured a standardized look and feel, similar to the one made popular by Apple's Macintosh computer .
</span>
Microsoft’s Windows operating system was first introduced in 1985, Windows 3 which was released in 1990 was the first version to see more widespread success, because it had the ability to run MS-DOS programmes in windows which brought multitasking in programming.


8 0
3 years ago
What refers to a metal combined with one or more other elements
alexira [117]
The correct answer is an Alloy.
8 0
3 years ago
Given six memory partitions of 300 KB, 600 KB, 350 KB, 200 KB, 750 KB, and 125 KB (in order), how would the first-fit, best-fit,
Inga [223]

Answer:

In terms of efficient use of memory: Best-fit is the best (it still have a free memory space of 777KB and all process is completely assigned) followed by First-fit (which have free space of 777KB but available in smaller partition) and then worst-fit (which have free space of 1152KB but a process cannot be assigned). See the detail in the explanation section.

Explanation:

We have six free memory partition: 300KB (F1), 600KB (F2), 350KB (F3), 200KB (F4), 750KB (F5) and 125KB (F6) (in order).

Using First-fit

First-fit means you assign the first available memory that can fit a process to it.

  • 115KB will fit into the first partition. So, F1 will have a remaining free space of 185KB (300 - 115).
  • 500KB will fit into the second partition. So, F2 will have a remaining free space of  100KB (600 - 500)
  • 358KB will fit into the fifth partition. So, F5 will have a remaining free space of 392KB (750 - 358)
  • 200KB will fit into the third partition. So, F3 will have a remaining free space of 150KB (350 -200)
  • 375KB will fit into the remaining partition of F5. So, F5 will a remaining free space of 17KB (392 - 375)

Using Best-fit

Best-fit means you assign the best memory available that can fit a process to the process.

  • 115KB will best fit into the last partition (F6). So, F6 will now have a free remaining space of 10KB (125 - 115)
  • 500KB will best fit into second partition. So, F2 will now have a free remaining space of 100KB (600 - 500)
  • 358KB will best fit into the fifth partition. So, F5 will now have a free remaining space of 392KB (750 - 358)
  • 200KB will best fit into the fourth partition and it will occupy the entire space with no remaining space (200 - 200 = 0)
  • 375KB will best fit into the remaining space of the fifth partition. So, F5 will now have a free space of 17KB (392 - 375)

Using Worst-fit

Worst-fit means that you assign the largest available memory space to a process.

  • 115KB will be fitted into the fifth partition. So, F5 will now have a free remaining space of 635KB (750 - 115)
  • 500KB will be fitted also into the remaining space of the fifth partition. So, F5 will now have a free remaining space of 135KB (635 - 500)
  • 358KB will be fitted into the second partition. So, F2 will now have a free remaining space of 242KB (600 - 358)
  • 200KB will be fitted into the third partition. So, F3 will now have a free remaining space of 150KB (350 - 200)
  • 375KB will not be assigned to any available memory space because none of the available space can contain the 375KB process.
8 0
3 years ago
What is the function of the GUI?
topjm [15]
C. Provides an interface between user and OS.
The GUI, or Graphical User Interface, is just about everything you generally see with a common computer or smartphone.  You rarely run an application or program from the command itself, as clicking an icon in the GUI runs the software for you.
6 0
4 years ago
Read 2 more answers
Other questions:
  • Which Boolean operator enables you to exclude a search term?
    9·2 answers
  • What can be used to provide a checklist of user tasks that must be included in the interface design?
    6·1 answer
  • What is the best way to improve the following code fragment? if ((counter % 10) == 0) { System.out.println("Counter is divisible
    13·1 answer
  • Craig wants to create a computing infrastructure that will allow developers within his company to build applications on a primar
    9·1 answer
  • Count characters Write a program whose input is a string which contains a character and a phrase, and whose output indicates the
    6·1 answer
  • describe what measures should have been taken by the educational service and test preparation provider to avoid the security bre
    11·1 answer
  • How are computers used in education and entertainment? List them.​
    10·1 answer
  • Consider the following class interfaces:
    8·1 answer
  • Please help it’s timed
    5·1 answer
  • Programs for embedded devices are often written in assembly language. Some embedded processors have limited instructions, like M
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!