Create Your First AI Project Using Python (Lesson 8)

What You Will Learn

In this lesson, you’ll learn:

  • How to create your first AI project using Python
  • How to organize project files
  • Why project structure is important
  • How to open your project in VS Code

Why Create a Project Folder?

A good project structure keeps your files organized. As your AI application grows, you’ll have Python files, configuration files, images, and other resources. Creating a dedicated project folder from the beginning is a good development practice.


Step 1: Create a Project Folder

Create a new folder anywhere on your computer. Example:

AI-Assistant

This folder will contain everything related to your AI project.


Step 2: Open the Project in VS Code

Open Visual Studio Code.

Click:

File → Open Folder

Select the AI-Assistant folder. You should now see the folder in the Explorer panel.


Step 3: Create Your First Python File

Inside the project folder, create a new file named:

app.py

This will be the main file for your AI Assistant.


Step 4: Write Your First Code

Open app.py and type:

print("Welcome to My AI Assistant")

Save the file.


Step 5: Run the Program

Open the Terminal in VS Code. Run:

python app.py

If your system uses Python 3, run:

python3 app.py

Output:

Welcome to My AI Assistant

Congratulations! 🎉You have created your first AI project. Although it doesn’t use AI yet, your development environment is now ready.


Your Project Structure

Your project should look like this:

AI-Assistant/
│
└── app.py

As we continue this course, we’ll add more files to this folder.


Why Use app.py?

Most Python projects have one main file that starts the application. Common file names include:

  • app.py
  • main.py

We’ll use app.py throughout this course.


Common Mistakes

Creating the file outside the project folder

Always create app.py inside the AI-Assistant folder.


Saving the file as app.txt

Make sure the file extension is:

app.py

Forgetting to save the file

Always save your file before running it.


Key Points

  • Create one folder for each project.
  • Keep all project files in the same folder.
  • Create the main Python file as app.py.
  • Run the project from the VS Code terminal.

Mini Quiz

1. What is the recommended project folder name in this tutorial?

A. Documents

B. AI-Assistant

C. Python

D. Projects

Answer: B


2. What is the main Python file used in this course?

A. index.py

B. start.py

C. app.py

D. hello.py

Answer: C


3. Which command runs the project?

python app.py

Answer: Correct


4. Where should app.py be created?

A. Desktop

B. Downloads

C. Inside the AI-Assistant folder

D. Anywhere

Answer: C


5. Why is a project folder important?

A. It organizes your files.

B. It makes projects easier to manage.

C. It keeps related files together.

D. All of the above.

Answer: D


Practice Exercise

Create a project named:

Student-AI

Inside it, create:

app.py

Write the following code:

print("My First AI Project")
print("Ready to build an AI Assistant!")

Run the file and verify that both lines are displayed.


Lesson Summary

In this lesson, you created your first AI project and organized it using a proper project structure. You also created the main Python file and successfully ran it from VS Code. Your project is now ready for AI integration.


Written by Shubhranshu Shekhar, who has trained 20000+ students in coding.

Scroll to Top