Programming With Python
Programming With Python
UNIT-1 ASSIGNMENT-1
Input:
Output:
Input:
Output:
Input:
Output:
4.Create a function convert_temperature(value,from_unit,to_unit) that converts
temperatures between Celsius,Fahrenheit, and Kelvin.
Input:
Output:
Input:
Output:
6.Write a recursive function(string_lengths)that calculates the length of a given
string without using built-in functions.
Input:
Output:
Input:
Output:
8.Write a recursive function count_ways(n) to calculate the numbers of ways to
climb n stairs, where you can take 1 or 2 steps at a time.
Input:
Output:
Input:
Output:
10.Write a recursive function matrix_sum(matrix) that calculates the sum of all
elements in a given matrix.
Input:
Output: