Python Coding And Programming: Start to learn the hard core of computer programming, data analysis and coding project in python by Learn Michael
Author:Learn, Michael [Learn, Michael]
Language: eng
Format: epub
Published: 2019-10-27T16:00:00+00:00
Math functions
One group of functions that is frequently required by basic math functions like log, sin, cos, sqrt. All of these can be used by importing the math library into the program. Once the math library is imported into the program, it becomes very easy to use complex mathematical operations and solve complicated equations. Here is a demonstration of some of the basic math functions using the dot notation.
>>>import math
>>>math.sqrt(2)/2.0
0.70710678
The trigonometric functions of sin, cos, tan etc can be performed using trigonometric math operations. These functions take radians in the arguments and give the results.
>>> radians = 0.7
>>> height = math.sin(radians)
If we have degrees, we can first convert them into radians by dividing it with 360 and multiplying it with twice of pi. The value of pi can be achieved by writing math.pi. Now pi is a variable and not a function so it is written without the () brackets.
>>> degrees = 45
>>>radians= degrees/360 *2*math.pi
>>>math.sin(radians)
0.70710678
There are a number of other functions available in the math library. We can explore it through learnPython.com and other web resources.
The names of the built in functions are also reserved and while naming variables we should avoid using them as variable names.
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Deep Learning with Python by François Chollet(12525)
Hello! Python by Anthony Briggs(9870)
OCA Java SE 8 Programmer I Certification Guide by Mala Gupta(9760)
The Mikado Method by Ola Ellnestam Daniel Brolund(9751)
Dependency Injection in .NET by Mark Seemann(9296)
Algorithms of the Intelligent Web by Haralambos Marmanis;Dmitry Babenko(8261)
Test-Driven iOS Development with Swift 4 by Dominik Hauser(7744)
Grails in Action by Glen Smith Peter Ledbrook(7670)
The Well-Grounded Java Developer by Benjamin J. Evans Martijn Verburg(7520)
Becoming a Dynamics 365 Finance and Supply Chain Solution Architect by Brent Dawson(6754)
Microservices with Go by Alexander Shuiskov(6521)
Practical Design Patterns for Java Developers by Miroslav Wengner(6419)
Test Automation Engineering Handbook by Manikandan Sambamurthy(6397)
Secrets of the JavaScript Ninja by John Resig Bear Bibeault(6381)
Angular Projects - Third Edition by Aristeidis Bampakos(5779)
The Art of Crafting User Stories by The Art of Crafting User Stories(5308)
NetSuite for Consultants - Second Edition by Peter Ries(5251)
Demystifying Cryptography with OpenSSL 3.0 by Alexei Khlebnikov(5070)
Kotlin in Action by Dmitry Jemerov(5022)
