Question

In: Computer Science

Develop a response to the questions below, which will address the basic concepts of programming. Remember...

Develop a response to the questions below, which will address the basic concepts of programming. Remember to use your textbook and other academic resources to justify your responses. Plausible responses to the questions below will also be discussed in class.

  1. Functions are the initial steps in modularizing your code to make it easier to manage and reuse. When you create a function, several procedural aspects change from writing the code in line with the rest of the code. The function must be defined, the function must be called, parameters may need to be passed in, and values may need to be returned. Describe a program of your choosing and the parts of the program that would be modularized in functions, what would need to be passed into the function when it is called, and what would be passed out of the function when it completes is anything.
  2. Not all functions are written by you; in fact, the vast majority of the functions you call will be built into the language or imported in a module. What are some built in functions you feel you will use regularly what are some libraries you think will be useful and for what?
  3. Built in functions and modules that come with languages are attractive to programmers. Identify a library that makes Python stand out in one particular area of programming that may make it the language of choice for that area of development.

Solutions

Expert Solution

  • In order to create programs that are readable, reliable, maintainable, we modularize the whole program, breaking one complex program into smaller , simpler parts.

To do so, we create functions, which is called to process the passed value and returns the processed value.

For eg:-

We could write a function which would return the perimeter of a square:-

#Fibonacci function
def Fibo(x):
    if x<=0:
        print("Incorrect input")
    # First Fibonacci number is 0
    elif x==1:
        return 0
    # Second Fibonacci number is 1
    elif x==2:
        return 1
    else:
        return Fibonacci(x-1)+Fibonacci(x-2)
 
#Driver Program for the above function
 print(Fibonacci(9))
 

The above function would return the xth fibonacci number.

In this case, that would be 21.

Here, the value of x is passed into the function when it is called, and the function passes out the value of xth fibonacci number on its completion.

  • The most used function in python or any other language would be a function to accept an input from the use or print the output.These can be called as the input-output or I/O functions.

In python, print() [print function] is used to display the output on the screen. It is a built-in function.

Another most common set of functions used are math functions, such as abs(), round(), sqrt(), etc.

In order to perform string operations, functions like append(), upper(), lower(), etc. are used.

  • Python being widely used for Data Science has libraries such as Numpy, Pandas, Matplotlib, Scipy, Scikit-learn, which are widely used in the field.

Numpy is a library, used to perform operations on multi-dimensional arrays and manage them.Numpy is the one of the most essential library as other libraries such as Pandas, Matplotlib , Scipy are built on Numpy.

Pandas library is used to manage the two-dimensional data-tables in Python, in the form of a database. Data can be loaded into data frames and operations could be performed on the selected data.

Matplotlib is a data-visualisation library. It helps to understand the data in an effecient way, by providing a visual of the same. It allows to create line graphs, pie charts, histograms, etc.One can customize every aspect of the figure according to the needs.

Scipy is used to perform scientific mathematical procedures such as optimization, linear algebra, interpolation, FFT, image processing, etc. as it contains various sub-modules to perform the same.

Scikit-learn is used for data-mining and data analysis.It is used to implement algorithms on datasets and solve real-world problems.

Due to the above libraries Python is widely used in Data Science, as it helps to solve complex problems easily with its supply of large collection of libraries that help to do so.

Comment in case of any doubts.


Related Solutions

Students are required to address the questions below by using academic theory and concepts. (Some suggested...
Students are required to address the questions below by using academic theory and concepts. (Some suggested resources covering aspects of the case have been posted on Blackboard as a start). Students are required to research the acquisition of Flipkart an e-commerce company based in India by Walmart the US multinational retail corporation. Overall word limit: 3000 QUESTIONS 1. With reference to the academic literature and using various units of analysis (global, national, industry) of external environmental factors, suggest the most...
a summary explaining the basic understanding of the following programming concepts using a language of python:...
a summary explaining the basic understanding of the following programming concepts using a language of python: •Variables •Arithmetic and Logical operations •Sequential coding (Structured programming •Decision structure (If statements) •Repetition structure •Functions with some coding demos inside visual studio code python IDE which can be sent as screenshot. preferably a typed summary please which can be written into powerpoint pleaseeeee ???
Identify the significance of the following. Remember to answer the basic questions: who, where, what, when,...
Identify the significance of the following. Remember to answer the basic questions: who, where, what, when, and why/ how. In other words, why was this person, idea, or event important in American history? What was/is significant about this term? 1) Trust -busting 2) square deal 3)New freedom 4)first and second new deal, Wagner act, social security act.
Please read the article below, and answer the questions that follow. In doing so, remember the...
Please read the article below, and answer the questions that follow. In doing so, remember the following, - Although the use of generic theories, covered in class/your module guide/text book will provide a framework, the expectation for the student is to be able to discuss it in context with research relevant to South Africa and your own reflective experiences. - You are required to extensively research current South African trends, amidst our changing political landscape and benchmarked against a global...
In the context of this course, you will be asked to address the issues/questions below for...
In the context of this course, you will be asked to address the issues/questions below for The Walt Disney Company (DIS). When addressing the issues/questions, be sure to do so in the context of this course and Disney. Your primary sources of information will come from the Disney website, in particular “Investor Relations” and the “2017 Annual Report.” Also, look at the web pages for Disney on Yahoo! Finance and/or Morningstar.com. a) Discuss the critical success factors and whether or...
In the context of this course, you will be asked to address the issues/questions below for...
In the context of this course, you will be asked to address the issues/questions below for Marriott International, Inc. (MAR), www.marriott.com. When addressing the issues/questions, be sure to do so in the context of this course and Marriott. You have been appointed as the special assistant to the Chief Executive Officer (CEO), Arne Sorenson, who has asked you to address the following five situations: (a) A fellow MBA alum from Lynn University, who now works in Admission at Lynn University...
Please address the question below and prepare a 2000 word response in traditional essay format. A...
Please address the question below and prepare a 2000 word response in traditional essay format. A good practice is one to include one reference every 100 words. Please remember that references are not included in word count and that a wide range of resources should be used for your assessment. A general rule of thumb for a 2000 word piece would be a minimum of six resources. ‘Prompted by the recession in Europe to search for promising wealthy new markets,...
For the below questions, write a thorough and complete response in the text box below. Go...
For the below questions, write a thorough and complete response in the text box below. Go to a popular online e-commerce site like Amazon.com. Place several items in your shopping cart, and then go to check out. When you reach the screen that asks for your credit card number, right-click on the Web browser and select “Properties.” What can you find out about the cryptosystems and protocols in use to protect this transaction? Repeat question 1 on a different Web...
In an approximately 500-word response, address the following issues/questions: Many businesses around the world still fail...
In an approximately 500-word response, address the following issues/questions: Many businesses around the world still fail because their capital investment decisions are based upon a calculation on the back of an envelope and do not take any of the correct factors into account. Even larger businesses often get this wrong. This is a true sign of poor resource management. • Do you agree or disagree? • Discuss the alternative methods of investment appraisal and describe the limitations of these to...
Please, answer below questions: Remember units. Use the correct number of significant figures. 1. A laser...
Please, answer below questions: Remember units. Use the correct number of significant figures. 1. A laser produces a beam of light with a radius of 1.7 mm. Its energy density is 9.17 10-7 J/m3 . a) What is its power? b) What is the force of its radiation pressure? 2. As light goes from air to an unknown liquid, an incident angle of 20.0° becomes a refracted angle of 13.1°. If light goes from the unknown liquid to air, what...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT