- Apply the
print()function to display multiple lines of text. - Use comments to document your code.
- Successfully submit your first assignment to the D2L dropbox.
Your First Assignment: An Introduction
Now that you know how to display text, let's write a program that introduces you. This assignment will confirm that your software is working and that you're ready for the rest of the course.
Your Task
Write a Python program that prints the following information, with each item on its own separate line:
- Your name.
- Your favourite hobby or activity.
- Something you hope to learn in this course.
Requirements
- If using Thonny, create a new file and save it as
introduction.py. - Your code must include comments. A comment is a line that starts with a
#symbol. The computer ignores these lines; they are notes for you or other programmers.
Example Code Structure:
# Introduction Program
# Author: Grace Hopper
# Date: September 5, 2025
# Print my name to the screen
print("My name is Grace Hopper.")
# Print my favorite hobby
print("My favorite hobby is tinkering with early computers.")
# Print my course goal
print("I hope to learn how to create the first compiler.")
How to Submit Your Work
Navigate to the D2L Assignment folder named "Activity 0.1: An Introduction". Choose the option below that matches your coding tool.
Option A: If you used Thonny
In the assignment submission area, click "Upload" and select your introduction.py file directly from your computer. This is the most straightforward method.
Option B: If you used an Online IDE (like Replit.com)
Online tools give you a shareable URL instead of a file. Here’s how to submit it:
- In your online IDE, find the "Share" button to get a shareable link to your code. Copy this link.
- Because D2L sometimes requires a file upload, create a simple placeholder document. You can open Notepad or any text editor and type "My Python code URL is in the comments section." Save this file as
my_url.txt. - In the D2L assignment folder, upload the
my_url.txtfile. - After uploading, you will see a "Comments for Submission" text box. Paste your shareable URL into this comments box.
This way, I will have both your placeholder file and the direct link to your code!