Computer Programming
Computer Programming
Fundamentals and
lllllll
Techniques
Presented by: Dr. Karima
Introduction
Researchers today face a world rapidly reshaped
by programming, artificial intelligence, and
cutting-edge technologies, necessitating
constant adaptation. Programming, now the
cornerstone of modern innovation and scientific
advancement, has transformed research
methodologies in every field.
Foster Collaboration
Acquire skills in collaborative programming and promote the use of
open-source languages like Python.
Training Program Structure
Part 1: Introduction to Computer Programming
Fundamentals using visual language (Blockly).
ST
Teaching Mode
Hybrid Approach
(Online and in person)
What is
Coding?
Coding is like writing instructions for computers
and other hardware. The computer read the
instructions (called programs) and does what you
have asked it to do.
Computer
Programming
Programming is an overall
Coding simply referes to term to describe the entire
writing code, which process of creating software.
instructs a computer to This involves writing code,
carry out an action. designing, testing an
debugging software.
Computer
Programming
Key Concepts
Key Concepts
Variables
Containers for storing different types of data, such as numbers or text.
Literals
Literals are representations of fixed values in a program maybe : integer , float, Boolean ,
string ,character, collection
Computer
Programming
Key Concepts
Operators
Here's a list of different types of Python operators that we will learn in this
tutorial.
Arithmetic Operators (+,-,*,/,//,%;**)
Assignment Operators(=)
Comparison Operators(<,> ,<=,>=,==,!=)
Logical Operators( and , or , not)
Membership operators(in ,not in)
Bitwise Operators
Special Operators
Computer
Programming
Key Concepts
Comments
Comments are hints that we add to our code to make it easier to understand.
Python comments start with # for one line and “”” for a lot of lines
Computer
Programming
How Programming?
Requirement Implementatio
Testing Phase
Gathering n
How Programming?
Instructions
Instructions
Instructions
Conditional instructions
If (condition is true)
Block 1
Else
Block 2
How Programming?
How Programming?
Instructions
Loops
For
While
repeat
How Programming?
Instructions
Loops
For
for i in range 10 :
Print(i)
How Programming?
Instructions
Loops
While (condition is true )
Do something
How Programming?
Instructions
Loops
Repeat
Something
Untill (condition of stop is ture )
Computer
Programming
TOP 4 PROGRAMMING
LANGUAGES
Naming Conventions
Use clear, descriptive names (e.g., `temperature` rather than `t`)
Follow camelCase or snake_case consistently
Avoid reserved words and special characters
Choose names that indicate the variable's purpose or content
Blockly: A Visual Programming
Language
Variable Declaration in Blockly
Creating Variables in Blockly
Blockly: A Visual Programming
Language
Selection: Decision Points
Selection structures enable decision-making capabilities within programs, allowing execution of
specific code blocks based on evaluated conditions. This creates dynamic responses to varying
inputs or states.
'If' Blocks
Evaluates a specified condition and executes the enclosed code block only when that condition is true.
if (path_is_clear):
move_forward()
'If-Else' Blocks
Extends functionality by providing an alternative execution path when the condition is false.
if (path_is_clear):
move_forward()
else:
turn_right()
Blockly: A Visual Programming
Language
Iteration: Efficient Repetition
Iteration enables code repetition, a critical capability for efficient programming.
Blockly implements this functionality through several loop structures:
Types of Loops
Repeat Loops: Execute code blocks a predetermined number of times
repeat 4 times:
move forward
turn right 90°