Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Assignment 3(Functions) 1. Write a function that can accept two variables and calculate the addition and subtraction of it. And also it must return both

image text in transcribed
Assignment 3(Functions) 1. Write a function that can accept two variables and calculate the addition and subtraction of it. And also it must return both addition and subtraction in a single return call 2. Write a function that accept name, and salary and display both, and if the salary is missing in function call it should show it as 9000 3. Write a function that returns area of circle. Hint: circle of area is pi*radius*radius a. define the Pi argument default value as 3.14 and radius should take user input. 4. Write a function that returns area of circle but pi value should come automatically. #Hint import math function and access pi value from there 5. Write a Python function to calculate the factorial of a number. The function accepts the number as an argument. 6. Write "help" document for the above factorial function(use doc strings) 7. Write a Python program to create a lambda function that adds 500 to a given number passed in as an argument 8. Write a Python program to create a lambda function that multiplies argument x with argument y and print the result. 9. Write lambda function that returns the odd numbers from an input list: li = [5. 7. 22, 97, 54, 62, 78, 23, 73,61] 10. Use the "map" function for the above example and print the Boolean values as an output Assignment4 (OOP) 11. Recreate all the class work with Student class instead of Car class. a. Create a student a class and student object. b. Init, self, Variables creation..etc pls repeat all the steps. 12. Inheritance: Demonstrate a scenario like various types of music like rock, blues, country, rap and pot. Recreate all the scenarios and demonstrate it

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago