💡 For the best experience, set your browser zoom level to 75%
75% للحصول على أفضل تجربة، اضبط مستوى تكبير المتصفح على 💡
Certificate
Completing this course's requirements qualifies the participant to receive a Certificate of Completion of 40 hours of training from the Arab Training Union (ATU).
Who This Course is for
Whether you want to become a software developer, data analyst, or AI practitioner, this course provides a strong foundation for your journey.
Trainer information
To ensure students can install Python, understand syntax and indentation, and use comments effectively.
1. Install Python and VS Code.
2. Write Your First Python Program.
Practice creating and using variables of different data types in Python.
1. Create and Print Variables:
· Create 4 variables:
o name as a string (your name)
o age as an integer (your age)
o height as a float (your height in meters)
o is_student as a boolean
2. Print Each Variable and Its Type:
· Use the type() function to print the data type of each variable.
Understand how to create variables with valid names, assign multiple values, and convert between data types.
1. Multiple Assignments:
o Assign values "apple", "banana", and "cherry" to variables a, b, and c in one line.
o Assign "fruit" to variables x, y, and z using a single line.
o Print all variables.
2. Casting Practice:
o Convert a string "50" to an integer and perform an addition with another number (e.g., 20).
o Convert an integer to a string and concatenate it with another string (e.g., name).
Apply string indexing, slicing, case conversion, and string checking in Python.
1. Create a string variable called message and assign it the value:
" The best things in life are free! "
2. Perform the following actions on the message variable:
o Print the original string.
o Use strip() to remove extra whitespace.
o Check if the word "free" is in the message using an if statement, and print an appropriate message.
o Print the string in both uppercase and lowercase.
o Print the length of the string using len().
o Slice and print characters from position 4 to 9.
Practice using string methods, user input, and Boolean logic in Python.
1. String Manipulation:
o Ask the user to enter a sentence.
o Replace the word "Python" with "Java" in their input.
o Split the sentence into words and print the resulting list.
o Convert the sentence to uppercase.
2. Boolean Practice:
o "You are an adult."
o or "You are a minor."
o Write a condition that checks if the user's age is greater than or equal to 18, and print either.
Practice using arithmetic, assignment, comparison, and logical operators in Python.
1. Arithmetic Operators:
o Create two variables: a = 15, b = 4
o Perform and print the result of the following operations:
§ Addition, Subtraction, Multiplication, Division, Modulus, Exponentiation, Floor Division
2. Assignment Operators:
o Start with x = 10
o Apply the following assignments and print x after each:
§ x += 5
§ x -= 3
§ x *= 2
§ x /= 4
Use for and while loops, apply break, continue, range(), and loop control structures in Python.
1. For Loop with List:
o Create a list of fruits: ["apple", "banana", "cherry"]
o Loop through the list and print each fruit.
2. Break and Continue:
o Inside the same loop, if the fruit is "banana", skip it using continue.
o In another loop, break the loop if the fruit is "cherry".
3. Using range() Function:
o Use a for loop with range(1, 11) to print numbers from 1 to 10.
o Then use range(1, 21, 2) to print odd numbers from 1 to 20.
Understand how to create, access, modify, and manipulate lists in Python.
1. Create and Print a List:
o Create a list named fruits with at least 5 fruits.
o Print the list and its length.
2. Access and Modify Items:
o Print the first and last items using indexing.
o Replace the second fruit with "blueberry" and print the updated list.
3. Slicing:
o Use slicing to print the 2nd to 4th items.
4. Check Existence:
o Check if "apple" is in the list and print "Yes" or "No" accordingly.
5. Add and Remove Items:
o Add a new fruit to the end using append().
o Insert a fruit at index 2 using insert().
o Remove a fruit using remove().
o Remove the last item using pop().
Task:
Write a Python program that performs the following:
1. Create a dictionary named student with keys "name", "age", and "grade".
2. Read and print all the values from the dictionary.
3. Change the "grade" value to something new.
4. Add a new key "school" with a value.
5. Remove the "age" key from the dictionary.
6. Print the final dictionary.
Write a Python script that includes the following:
1. A function called full_name that takes first_name and last_name as arguments and returns the full name.
2. A function called sum_all that uses arbitrary arguments (*args) and returns the sum of all values passed.
3. A lambda function that squares a number.
4. Call all these functions and print the results clearly.
Write a Python class called Student that has the following features:
1. A constructor (__init__) that takes name, age, and grade as parameters.
2. A method called info() that prints the student’s full details.
3. Create an object s1 from the Student class.
4. Change the grade of the student.
5. Delete the age property.
6. Delete the object itself.
Write a Python script that:
1. Creates a global variable x = 50. Inside a function, change its value to 100 using the global keyword and print both values (before and after).
2. Creates a datetime object for your birthday and prints it using strftime() in the format: Day Month, Year (e.g., 24 May, 1998).
3. Uses the math module to:
o Calculate and print the square root of a number.
o Round a floating number to the nearest integer.
o Find the value of sin(90°) using radians.
Write a Python program that:
1. Asks the user to input a number.
2. Tries to divide 100 by that number using try-except.
o Handle ZeroDivisionError and ValueError.
o Use else to print the result if no exception occurs.
o Use finally to print "Execution finished." no matter what.
3. Use the raise keyword to raise an error if the number is negative.
4. Format the final message using .format() to show the input and result.
Write a Python script that:
1. Creates a text file called data.txt and writes three lines of text into it.
2. Reopens the same file and reads:
o The entire content using read()
o The first line using readline()
3. Closes the file.
4. Uses the os.path.exists() method to check if data.txt exists.
o If it exists, delete it using os.remove()
o Otherwise, print "File does not exist."
5. Creates a folder called test_folder and then removes it using os.rmdir() (after checking it exists).
Write a short script (or use command line) to perform the following tasks:
1. Check and print the current version of pip installed.
2. List all installed packages.
3. Install the package requests using pip.
4. Upgrade the package requests.
5. Uninstall the package requests.
1. Create a MySQL database named company.
2. Using Python and the pymysql module:
Insert at least 3 records into the employees table.
Lesson 17 – Assignment
Title: Drawing a Simple Scene using Python Graphics
Objective:
Use the graphics.py module to draw a simple graphical scene that includes the following shapes and text:
Instructions:
1. Import everything from the graphics module: from graphics import *
2. Create a GraphWin object with title and size.
3. Use Circle, Line, Oval, and Text to design the scene.
4. Use the draw(window) method to display each object.
5. Add color to at least two shapes using setFill().
Title: Build a digital clock app with these features:
Features:
1. Show the current time in a large Label widget, updated every second.
2. Provide a Dropdown menu (OptionMenu) or Radiobuttons to select from at least three different themes, for example:
o Light (white bg, black text)
o Dark (black bg, white text)
o Blue (blue bg, yellow text)
3. Provide a Scale (slider) widget to adjust the font size of the clock text dynamically.
4. When the user changes the theme or font size, update the display immediately.
5. Display time in 24-hour format (HH:MM:SS).
Title: Flask Session App — Store and Reset User Name
Objective:
Build a small Flask web app with a frontend form that allows a user to enter their name. The name should be stored using the Flask session. The user should also be able to reset (clear) their name.
Requirements:
1. A simple HTML form (use render_template) where the user can input their name.
2. Store the name using session['name'].
3. Display the name after submission.
4. Provide a button to reset/clear the session (remove the name).
5. Use routes like /, /submit, and /reset.
Title: Data Cleaning and Visualization Project
Objective:
Analyze a CSV dataset by handling missing data, removing duplicates, converting data types, calculating correlations, and visualizing results with scatter and line plots.
Instructions:
1. Load a CSV file using pandas.
2. Handle missing data by:
o Dropping rows with too many missing values.
o Filling missing values in numerical columns with the mean.
o
3. Remove duplicates using drop_duplicates().
4. Convert data types:
o Convert a date column to datetime.
o Convert a numeric column from string to float/int.
5. Perform correlation analysis:
o Use df.corr() to find correlation between numerical columns.
6. Create a scatter plot:
o Show the relationship between two numeric columns using plt.scatter().