Giter VIP home page Giter VIP logo

guttag-2013-finger-exercises's Introduction

Guttag-2013-Finger-Exercises

My finger exercise answers for Introduction to Computing and Programming using Python (Guttag, 2013)

Questions answered so far:

Finger 2.1

#Finger exercise: Write a program that examines three variables— x , y , and z — #and prints the largest odd number among them. If none of them are odd, it #should print a message to that effect.

Finger 2.4

#Finger exercise: Write a program that asks the user to input 10 integers, and #then prints the largest odd number that was entered. If no odd number was #entered, it should print a message to that effect.

Finger 3.1

#Finger exercise: Write a program that asks the user to enter an integer and #prints two integers, root and pwr , such that 0 < pwr < 6 and root**pwr is equal #to the integer entered by the user. If no such pair of integers exists, it should #print a message to that effect.

Finger 3.2

#Finger exercise: Let s be a string that contains a sequence of decimal numbers #separated by commas, e.g., s = '1.23,2.4,3.123' . Write a program that prints #the sum of the numbers in s .

Finger 3.3

#Finger exercise: What would have to be changed to make the code in Figure #3.4 work for finding an approximation to the cube root of both negative and #positive numbers? (Hint: think about changing low to ensure that the answer #lies within the region being searched.)

Finger 3.4

#Finger exercise: What is the decimal equivalent of the binary number #10011 ?

Finger 3.5

#Finger exercise: Add some code to the implementation of Newton-Raphson that #keeps track of the number of iterations used to find the root. Use that code as #part of a program that compares the efficiency of Newton-Raphson and bisection #search. (You should discover that Newton-Raphson is more efficient.)

Finger 4.1

#Finger exercise: Write a function isIn that accepts two strings as arguments #and returns True if either string occurs anywhere in the other, and False #otherwise. Hint: you might want to use the built-in str operation in .

Finger 4.3

#Finger exercise: When the implementation of fib in Figure 4.7 is used to #compute fib(5) , how many times does it compute the value fib(2) ?

Finger 7.1

#Finger exercise: Implement a function that meets the specification below. Use a try-except block.

Finger 7.2

#Finger Exercise: Implement a function that satisfies the specification

guttag-2013-finger-exercises's People

Contributors

astoned avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.