Introduction_IT
Introduction_IT
ET00BN16-3001
•Introduction etc.
About the course
Goals:
• The student knows basics of programming and knows how to write short programs in
some programming language (in this course, we use Python).
• The student knows the consept of artificial intelligence and can use some online tools.
Contents:
• Basic elements of programming: variables, expressions, conditional statement (if
statement), loops (for, while), lists and functions
• Artificial intelligence: machine vision, voice recognition, mobility detection
• The grade
•Exam (during the last lecture)
•The homework submitted in Moodle
•The artificial intelligence project
• Moodle:
•ET00BN16-3001 Information Technology
•I’ll also add solutions to the excersises after those have been checked during the
lectures.
• What is programming?
•Giving instructions, what the computer should do.
•The set of instructions given to a computer to perform a specific task is called a
program
• Grouping by purpose:
•General purpose can be used to write large and versatile software applications for
different fields
• E.g. customer registry maintenance, card and board games, or robot control
• Suitable for both web server applications (e.g., online stores) and desktop applications
• E.g. Java, C#, Visual Basic
•Some programming languages are designed solely for writing web applications
• E.g. PHP
•Others are suitable for system-level programming
• E.g. C
•Some are used for scripting on web pages
• E.g. JavaScript
•An interpreter, on the other hand, processes the source code line by line, translating
each line into machine code, which the computer executes immediately after
translation.
• Python is an interpreted language.
• Programming requires logical thinking, and tasks are solved using a specific
thought model
•What is the goal, what is the wanted outcome?
•What needs to be done first?
•What is done after that?
•Are there any conditions that affect the actions. Etc.
• Typically, one first outlines how to act to achieve the desired outcome, forming
an algorithm, which defines the steps required to solve the task
• An algorithm can be visualized using a flowchart.
End
5.9.2024 Information Technology 15
Introduction – Start
FALSE
Number ≥ 0
• When selecting from
alternative actions, it is called TRUE
a selection structure. Calculate
• This requires a condition Print error message
the squareroot
5.9.2024 Tietotekniikka 20
Introduction - Example 1.1
• If a statement is too long to fit on one line, you can break the line within
parentheses (), {}, []. If you break the line elsewhere, put a backslash \ at the
end of the line.
End
• Now we have a variable r which will have the user-given value when the
program is run.
• The next step would be
Calculate the area
with the given radius
• area = 3.1415926 * r ** 2
• Python supports standard arithmetic operators + (addition), - (subtraction), *
(multiplication), / (division).
•The exponentiation operator is **
•Decimal separator is a dot
• If units are required, provide instructions to the user on what units to use for
the radius and add the unit to the answer