teaching computer based math and computer science using python
DESCRIPTION
Computer programming contributes an essential aspect to a well-rounded computer literacy. The open-source Python language was designed to be easy for beginners to learn and is appropriate as a first computer language.TRANSCRIPT
![Page 1: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/1.jpg)
“Teaching Computer Based Math and Computer Science Using Python”
Andrei CORLAT, Doctor în matematică, Şef Catedra Matematică şi Informatică, UnAŞM
Oxana GRAJDIANU, UnAŞM
![Page 2: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/2.jpg)
Teaching Mathematics
![Page 3: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/3.jpg)
Teaching Computer ScienceYoung people consider themselves "digital natives" because they can text and chat and play games, “but using technologies doesn’t really make one a digital native or fluent in technology.”
Mitch Resnick at TEDxBeaconStreet
![Page 4: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/4.jpg)
Computer Based Mathematics
![Page 5: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/5.jpg)
Benefits of Programming for learning Mathematics“Learning to code means learning how to think creatively, reason systematically and work collaboratively. And these skills are applicable to any profession — as well as to expressing yourself inyour personal life, too."
Mitch Resnick
![Page 6: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/6.jpg)
Python as the first programming language● Simple● Easy to Learn● Free and Open Source● High-level Language● Portable ● Interpreted● Object Oriented● Extensible● Embeddable
![Page 7: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/7.jpg)
Peculiarities of Python Programming Language
Position Mar 2014
PositionMar 2013
Delta in position
Programming language Share in Marc 2014
Twelve monthtrends
1 1 Java 26.9 % -0.5 % 2 2 PHP 13.5 % -1.5 %
3 4 Python 10.6 % +0.6 % 4 3 C# 10.5 % -0.1 %
5 5 C++ 8.8 % -0.5 %
6 6 C 8.1 % +0.2 %
7 7 Javascript 8.0 % +0 % 8 8 Objective-C 6.4 % +1.6 %
9 9 Visual Basic 3.1 % +0.3 % 10 10 Ruby 2.5 % +0 %
© 2014 Pierre Carbonnelle
![Page 8: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/8.jpg)
Comparing Python to other programming languagesThe "Hello, world" program in Python is about as simple as it can get:
>>> print "Hello, world!"Hello, world!
In Java, much more overhead is needed:
class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); }}
![Page 9: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/9.jpg)
Comparing Python to other programming languagesThe "Hello, world" program in Python is about as simple as it can get:
>>> print "Hello, world!"Hello, world!
In Pascal Programming Language:
program HelloWorld;begin writeln('Hello World');end.
![Page 10: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/10.jpg)
Python in SchoolsPython and Math is an approach to apply programming skills to solving
math problems. Here are the main objectives:
● Introduce programmers to solving math problems
using programming.
● Practice problem-solving skills
using programming.
● Introduce new skills and techniques
that increase the efficiency of programs.
![Page 11: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/11.jpg)
Unlock the Power of Computer with PythonThere are two main advantages that programming a computer has over doing the calculation yourself:
● Speed: computers can do more calculations in a second than most will do in their lifetime.
● Repetition: computers do the same thing over and over and never complain.
![Page 12: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/12.jpg)
Gauss and Loops >>> total = 0 #A variable storing our running total.
>>> for x in range(1,101): #Range(1,101) stops at 100.
total = total + x #Code inside a loop is indented.
>>> print(total) 5050
![Page 13: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/13.jpg)
Randomness and Case Statements>>> import random>>> flipResult = 0>>> heads = 0>>> tails = 0>>> for flips in range(1,101): flipResult = random.randint(1,2) if (flipResult == 1): print ("Heads") #Students like seeing the flip results. heads = heads + 1 if(flipResult == 2): print ("Tails") tails = tails + 1
>>> print ("heads= %i" % heads) >>> print ("tails= %i" % tails) >>> print(heads/tails)
![Page 14: Teaching Computer Based Math and Computer Science Using Python](https://reader034.vdocuments.net/reader034/viewer/2022052621/55874ca4d8b42acd168b46ae/html5/thumbnails/14.jpg)
Randomness and Case Statements - Output
TailsTailsHeadsTailsTailsTailsHeadsTailsHeadsTailsTailsTailsTailsTailsHeadsHeadsTailsTailsHeadsTailsTailsHeadsHeadsHeadsTails
TailsTailsTailsHeadsTailsHeadsHeadsTailsTailsHeadsHeadsTailsHeadsTailsTailsHeadsHeadsTailsTailsHeadsHeadsHeadsTailsTailsTails
HeadsTailsHeadsTailsHeadsHeadsTailsHeadsTailsTailsTailsHeadsHeadsTailsHeadsTailsheads = 45tails = 550.8181818181818182