Python Course 101

Assignment 1: Python Basics

Objective

In this assignment, you will practice the basic syntax and data types of Python. You will write a Python program that demonstrates your understanding of variables, data types, and basic operators.

Instructions

  1. Create a new Python file named assignment1.py.
  2. Write a program that does the following:
    • Asks the user for their name and age.
    • Stores the user's name and age in variables.
    • Prints out a greeting message that includes the user's name and age.
    • Calculates and prints out the user's age in days.
  3. Use the following data types:
    • String (for the user's name)
    • Integer (for the user's age)
  4. Use the following operators:
    • Assignment operator (=)
    • Addition operator (+)
    • Multiplication operator (*)
  5. Use the input() function to get user input.
  6. Use the print() function to print output.

Example Output

1
2
3
4
Enter your name: John
Enter your age: 25
Hello, John! You are 25 years old.
You are 9125 days old.

Grading Criteria

  • Correctness (40%): Does the program produce the correct output?
  • Code quality (30%): Is the code well-organized, readable, and concise?
  • Use of data types and operators (30%): Are the correct data types and operators used?

Submission

Submit your assignment1.py file to the course dropbox folder by the deadline.

Deadline

  • March 22, 2023, 11:59 PM EST

Tips and Resources

  • Use the official Python documentation for reference.
  • Use a Python IDE or text editor to write and run your code.
  • Test your code thoroughly before submitting.

Additional Help

If you need help or have questions, don't hesitate to ask your instructor or classmates. You can also seek help from online resources, such as:

  • Stack Overflow
  • Python documentation