From the course: Python: Programming Efficiently

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Python vs. C

Python vs. C - Python Tutorial

From the course: Python: Programming Efficiently

Start my 1-month free trial

Python vs. C

- [Instructor] Python is significantly more expressive, than other widely used languages, such as C. By expressive, I mean that Python makes it easy to write code that's brief, and yet readable. You can do more by writing less, and when you read the code back, you get quickly what it does. To compare C and Python, we'll write a simple program to compute the value of pi, you know, 3.14 and so on. Half the ratio of the circumference, to the radius, in a circle. We will compute pi, using the Leibniz series. Which is an infinite sum of fractions, starting from one, 1/3, 1/5, 1/7, and so on. This series is actually a good showcase, for the mathematical rendering abilities of jupyter notebooks. If I press Return to show the source code of this markdown cell, you see how the mathematical expression is encoded using the lattic language. By the way, this is not the best way to compute pi, because the terms in the…

Contents