Questions on Python Functions

Questions on Python Functions


Varanasi Software Junction: Questions on Python Questions


  • Write a function to calculate Simple Interest and Compound Interest.
  • Write a function to find the maximum o 2 numbers. Use it to find the max of 3 numbers.
  • Write a function that takes as input hours and minutes in 24 hr format and adjusts to 12 hour format. 
    11:45 becomes 11:45 AM
    12:45 becomes 12:45 PM
    13:45 becomes 1:45 PM
  • Write a function to calculate the sum of a list of numbers
  • Write  a program to convert a decimal number to binary
  • Write a program to input a,b and c as a dictionary and calculate the roots of a quadratic equation.
  • Write a program to find the nth Fibonacci number.
  • Write a program print the table of a number given n.
  • Write a function to check if a number is part of the Fibonacci series.
  • Write a series of functions to print the calendar of a given year and month.

Contact us for software training, education or development










 

Post a Comment

Me
Me
WhatsApp Contact Me on WhatsApp
×

📩 Today’s Programming Tip

✅ Python Tip: Use zip() and unpacking to transpose a matrix.
Example:
matrix = [[1, 2], [3, 4], [5, 6]]
print(list(zip(*matrix)))

🔗 Learn More

💡 Tip of the Day