Main.Assignment7 History

Hide minor edits - Show changes to markup

March 07, 2010, at 09:08 PM MST by 71.196.160.210 -
Added lines 8-15:

Put the function in a file called multiply.py and have your program ask the user for two integers. If the input provided by the user are not integers, your program should raise an exception.

Recursive counting

Write a function count(s, char) that counts the number of times the character char occurs in the string s. Do it using recursion without any loop construct.

Put the function in a file called count_char.py.

March 07, 2010, at 08:32 PM MST by 71.196.160.210 -
Added lines 3-4:

Due date: 3/22/10

Changed lines 7-8 from:

Write a function mult(x, y) that recursively computes the value of x * y, where x and y are integers, without using multiplication, or any loop construct. Your function should be able to handle negative numbers as well.

to:

Write a function mult(x, y) that recursively computes the value of x * y, where x and y are integers, without using multiplication, or any loop construct. Your function should be able to handle negative numbers as well.

March 07, 2010, at 08:23 PM MST by 71.196.160.210 -
Added lines 1-5:

Assignment 7

Recursive multiplication

Write a function mult(x, y) that recursively computes the value of x * y, where x and y are integers, without using multiplication, or any loop construct. Your function should be able to handle negative numbers as well.