Week 1
Week 1
Week 1
to Programming
http://www.ufv.ca/cis/
January 4, 2024
About — Dr. Faisal Naeem
Experience:
• Senior Machine Learning Research
Engineer, ReMI ( 2022 - 2023)
• Postdoctoral Research Fellow, ReMI ( 2022 -
2023)
• PhD., NUCES-FAST (Sep. 2018 - Aug. 2021)
Let us all:
•Real-World Example:
• Industry Demand: Companies in tech, automotive, healthcare, and more actively seek
programmers with expertise in areas like face recognition, autonomous driving, and artificial
intelligence.
PROBLEM
SOLVING
PRACTICE
8 6.00
01
LEC
TUR
E1
KNOWLEDGE PROGRAMMING
OF CONCEPTS SKILL
FAST PACED COURSE
Fundamentally:
◦ performs calculations
a billion calculations per second!
1
4 ◦ remembers results 6.00
01
LEC
TUR
100s of gigabytes of storage! E 1
What kinds of calculations?
◦ built-in to the language
◦ ones that you define as the programmer
computers only know what you tell them
TYPES OF KNOWLEDGE
1 6.00
5 01
imperative knowledge is a recipe or
TUR “how-to achieve it”.
LEC
E1
WHAT IS A RECIPE
1+2+3 = an algorithm!
STORED PROGRAM COMPUTER
1
Python High Level Programming Language
interpret
source code byte code output
Hello.java Hello.class
2
ASPECTS OF LANGUAGES
primitive constructs
◦ English: words
◦ programming language: numbers, strings,
simple operators
2 6.00
1 01
LEC
TUR
E1
Word Cloud copyright Michael Twardos, All Right Reserved. This content is excluded from our Word Cloud copyright unknown, All Right Reserved.
Creative Commons license. For more information, see https://ocw.mit.edu/help/faq-fair-use/. This content is excluded from our Creative
Commons license. For more information, see
https://ocw.mit.edu/help/faq-fair-use/.
ASPECTS OF LANGUAGES
Syntax
◦ English: "cat dog boy" not syntactically valid
"cat hugs boy" syntactically valid
◦ programming language: "hi"5 not syntactically valid
3.2*5 syntactically valid
2 6.00
Logic
2
errors 01
LEC
TUR
E1
Runtime
print(1/0)
WHERE THINGS GO WRONG
syntactic errors
◦ common and easily caught
static semantic errors
◦ some languages check for these before running program
◦23can cause unpredictable behavior 6.00
01
LEC
TUR
E1
no semantic errors but different meaning than what
programmer intended
◦ program crashes, stops running
◦ program runs forever
◦ program gives an answer but different than expected
Practice examples
2 6.00
4 01
LEC
TUR
E1
Class activity Quiz
PYTHON INSTALLATION
https://www.jetbrains.com/pycharm/download/?section=windows
2 6.00
6 01
LEC
TUR
E1
PYTHON FIRST PROGRAM
print("Hello, World!“)
Syntax Errors
Print["Hello, World!“]
Runtime
2
7 Errors 6.00
01
LEC
TUR
E1
Print (1/0)
Logic Errors
# Convert Fahrenheit to Celsius
print("Fahrenheit 35 is Celsius degree ")
print(5 / 9 * 35 - 32)
PYTHON DATA TYPES
Integer
Float
2 6.00
String8 01
LEC
TUR
E1
Boolean
PRACTICE EXERICE
2 6.00
9 01
LEC
TUR
E1
Studying for this course!
Success tips: