Ceng1004 Introduction
Ceng1004 Introduction
Ceng1004 Introduction
Lecture 1
Introduction
Spring 2023
Today
• Course information
• Why Python?
• Python Installation
Tentative Grading:
• 40% midterm
• 20% written midterm exam
• 10% quizzes (2)
• 10% homework
• 60% final
• 40% written final exam
• 10% quizzes (2)
• 10% homework
Course Information
• To succeed:
• do practise
• PRACTISE. PRACTISE? PRACTISE!
• do not skip lectures
• do not be afraid writing code
Why Python?
python
Easy to learn
print('Hello, World!')
• Understandable and
easy to read code
#include <stdio.h>
int main(){
• Free
printf('Hello, World!');
return 0;
}
Python Installation
❖ Loops (repeated steps) have iteration variables that change each time
through a loop.
A program is a Recipe
• primitive constructs
• English: words
• programming language: numbers, strings, simple operators
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
Aspects of Languages
• programming language:
• 3.2*5
• syntactically valid
• 3+"hi"
• static semantic error
Aspects of Languages
• syntactic errors
• common and easily caught
For example, an algorithm to compute the area of a circle given its radius
might look like this: