Home | | Computer Science 12th Std | Functions using libraries

Python - Functions using libraries | 12th Computer Science : Chapter 7 : Core Python : Python Functions

Chapter: 12th Computer Science : Chapter 7 : Core Python : Python Functions

Functions using libraries

Built-in and Mathematical functions

Functions using libraries

Built-in and Mathematical functions








Mathematical Functions



Composition in functions

What is Composition in functions?

The value returned by a function may be used as an argument for another function in a nested manner. This is called composition. For example, if we wish to take a numeric value or an expression as a input from the user, we take the input string from the user using the function input() and apply eval() function to evaluate its value, for example:

Example :

This program explains composition

>>>n1 = eval (input ("Enter a number: "))

Enter a number: 234

>>>n1

234

>>>n2 = eval (input ("Enter an arithmetic expression: "))

Enter an arithmetic expression: 12.0+13.0 * 2

>>> n2

38.0

 

Tags : Python , 12th Computer Science : Chapter 7 : Core Python : Python Functions
Study Material, Lecturing Notes, Assignment, Reference, Wiki description explanation, brief detail
12th Computer Science : Chapter 7 : Core Python : Python Functions : Functions using libraries | Python


Privacy Policy, Terms and Conditions, DMCA Policy and Compliant

Copyright © 2018-2023 BrainKart.com; All Rights Reserved. Developed by Therithal info, Chennai.