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
Illusion [34]
3 years ago
8

Write a function that takes as input a single integer parameter n and computes the nth Fibonacci Sequence number. The Fibonacci

sequence first two terms are 1 and 1. (so, if n = 2, your function should return 1). From there, the previous two values are summed to come up with the next result in the sequence 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, etc.
Computers and Technology
1 answer:
RSB [31]3 years ago
4 0

Answer:

Following are the code to this question:

def Fibonacci(n):#defining a method Fibonacci that accept a parameter

   a = 1#defining a variable a that holds a value 1

   b = 1#defining a variable b that holds a value 1

   if n <= 0:# Use if to check n value

       print("invalid number")#print message

   elif n == 2:#defining elif that check n equal to 2

        return 1#return 1

   else:#defining else block

       print(a)#print value of a

       print(b)#print value of b

       for i in range(2,n):#defining for loop to calculate series

           s = a + b# add value in s variable

           a = b # interchange value

           b = s# hold s value

           print(s)#print s value

Fibonacci(10)#calling method

Output:

1

1

2

3

5

8

13

21

34

55

Explanation:

In the above-given program code, a method "Fibonacci" is defined, which holds a value "n" in its parameter, and inside the method two-variable "a and b" is defined, that holds a value "1".

  • In the next step, if a block is defined that checks n value is less than equal to 0, it will print "invalid number" as a message.
  • In the elif, it checks n value is equal to 2 it will return a value that is 1.
  • In the else block, it will calculate the Fibonacci series and print its value.
You might be interested in
Assume you're using a three button mouse. to access shortcut menus you would
jekas [21]
<span>Normally you would click the right hand/secondary mouse button but you may configure any of the buttons to work within the Keyboard and Mouse section of System Preferences.</span>
7 0
3 years ago
Select the answers that best describe showing respect for confidential data. Check all of the boxes that
kupik [55]

Answer:

The first (The security administrator makes sure to shred and properly dispose of any printed confidential information) and third (The security administrator uses password-protected files and folders on his work computer.) ones are correct.

3 0
4 years ago
___ data is ____data; non-numeric data; observations are organized into categories without any recognition of order.
Virty [35]

Nominal data is qualitative data; non-numeric data; observations are organized into categories without any recognition of order.

<h3>What is qualitative data?</h3>

Qualitative data is information that cannot be counted, measured or easily expressed using numbers.

It is collected from text, audio and images and shared through data visualization tools, such as word clouds, concept maps, graph databases, timelines and infographics.

Qualitative data is the descriptive and conceptual findings collected through questionnaires, interviews, or observation.

Analyzing qualitative data allows us to explore ideas and further explain quantitative results.

For example, it could be notes taken during a focus group on the quality of the food at Cafe Mac, or responses from an open-ended questionnaire.

To learn more about qualitative data, refer

brainly.com/question/3151198

https://brainly.ph/question/5565846

#SPJ4

5 0
2 years ago
Which of the following are all involved in the evaluation of the presentation of a speech?
ikadub [295]

Answer:

C.

Explanation:

The elements involved in the evaluation of the presentation of a speech includes visual aids, vocal technique, and body language.

Adding vivid pictures in the presentation makes it graphic and proficient. The visual aids in presentation also provides the succinct and clear meaning of the message to the reader.

The vocal technique is another element that adds value in presentation. A speaker's confidence is reflected through his/her tone. It is the speaker's voice that becomes an influential tool that draws the audience's attention.

Body language, like vocal technique, helps in effective delivering of the speech. Body language is a non-verbal form of communicatin that communicates a lot to the audience than one can imagine.

Therefore, option C is correct.

6 0
3 years ago
A train schedule is an everyday, real-life example of an array. Identify at least four more.
lozanna [386]

Answer:

  1. The salary schedule of employees in a company.
  2. The loan payback schedule.
  3. The grading scale of the professor.
  4. The tax table.

Explanation:

An array is a linear data structure.It stores the elements of similar data type.It provides the element and index because of which it is easy to access the array elements if you know the index.Some of the real life examples of arrays are as following:-

  1. The salary schedule of employees in a company.
  2. The loan payback schedule.
  3. The grading scale of the professor.
  4. The tax table.
7 0
3 years ago
Other questions:
  • The font size on presentation slides should not be smaller than _____ -point.
    10·1 answer
  • Create a class called Name that will have three fields first name, middle initial, and last name as parameters. Add a constructo
    15·1 answer
  • How to find something in the cloud?
    8·1 answer
  • PLEASE HELP ME ASP!!!
    11·2 answers
  • After class, Anita and Bev make plans to study for their psychology exam together but cannot decide on a time or location. In ad
    7·1 answer
  • In the single-site processing, single-site data (SPSD) scenario, all processing must be done on the end user's side of the syste
    10·2 answers
  • The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09
    11·1 answer
  • Assume myString and yourString are variables of type String already declared and initialized. Write ONE line of code that sets y
    15·1 answer
  • To cope with the uncertainty about how their pages will be viewed, many web page designers opt to use _________ units, which are
    13·1 answer
  • Um ok that makes sooo much sence
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!