0% found this document useful (0 votes)
8 views8 pages

CMPE1003 Lecture Notes - Introduction 2022

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views8 pages

CMPE1003 Lecture Notes - Introduction 2022

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

CMPE1003: Programming

and Problem Solving for


Engineers

Dr. Dale C. Roach, PhD, PEng


Department of Engineering
UNB Saint John
Fall 2022
Chapter 1: Introduction and
Some Other Stuff
• Some engineers work in software development and
develop apps

• Saves a tremendous amount of time, especially when


Why You Need repeating a calculation or correcting an error in the
calculation
to Learn to
Program • Computers are WAY faster than humans

• Some problems can’t be practically solved on a calculator

• Allows you to explore a problem by visualizing results


rather than getting bogged down in calculations.

3
• There are MANY popular programming languages
with new ones being created all the time to meet
specific needs.

Popular • For scientific computing, there are a handful of


languages that are worth mentioning:
Languages
• COBOL
• FORTRAN Fast
• C/C++
• MATLAB
• Python Not So Fast (?)

4
Background on Python
• Python was created by Guido van Rossum who
started development in the late 1980s and
released the first version in 1991.
• Guido retired from the development team in
July 2018
• Since then Python has grown its user base and is
now one of the most popular languages.
• It is used by companies like Google and
NASA!
• Python is open source and development is still
on-going and carried out by a dedicated
community.
• Python gets its name from the British comedy
group Monty Python.

https://en.wikipedia.org/wiki/Python_(programming_language) 5
Excerpts from “The Zen of Python”
• Beautiful is better than ugly.
• Explicit is better than implicit.
• Simple is better than complex.
• Complex is better than complicated.
• Readability counts.
• There should be one – and preferably only one –
obvious way to do it.

Tim Peters

Ref: https://peps.python.org/pep-0020/

6
High-level language, interpreted, general purpose,
emphasizes code readability

Dynamically typed

Python Tech Garbage collected


Specs
Structured programming
Multi-paradigm Object-oriented programming
Functional programming

Just means it can work with a lot


Highly extensible of other stuff
You can add what you need

7
Reserved Words • False • class • global • raise
in Python 3.9 • None • continue • if • return
• True • def • import • try
• __peg_parser__ • del • in • while
• and • elif • is • with
• as • else • lambda • yield
• assert • except • nonlocal
• async • finally • not
• await • for • or
• break • from • pass

Words in red have been added since your textbook was printed.
8

You might also like