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 Tutorial
From the course: Python: Programming Efficiently
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
(Locked)
Writing Python efficiently50s
-
(Locked)
Python vs. C4m 40s
-
(Locked)
Design efficient loops7m 3s
-
(Locked)
Comprehensions and generators6m 41s
-
(Locked)
Exploit Python collections7m 14s
-
(Locked)
Write Pythonic code6m 44s
-
(Locked)
Challenge: Analyze Olympic medalist data1m 20s
-
(Locked)
Solution: Analyze Olympic medalist data1m 33s
-
(Locked)
-
-
-
-