Skip to content

Raising-Arrows-Academy/assignment_variables_conditionals

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Variables and Conditional Statements Assignment

About This Assignment

This assignment lets you practice what we learned in class about variables and conditional statements in Python. You'll write code to create variables, use them to store information, print them out, and then use conditional statements to make decisions based on those values.

What You'll Learn:

  • How to create and use variables (strings, numbers, booleans)
  • How to print variable values
  • How to write if, elif, and else statements to make decisions in your code

Your Task: Open main.py and follow the 3 steps outlined in the comments. Each step has clear instructions to guide you!

🚀 Getting Started

Your coding environment is already set up and ready to go. Everything you need is installed automatically!

Your environment includes:

  • Python (ready to run your code)
  • Python Test Explorer (to check your work with the beaker icon 🧪 in the sidebar)
  • A Python Debugger (to step through code and find bugs)
  • Auto-Formatting (your code looks clean when you save)

💻 Running Your First Program

Once your Codespace is ready:

  1. Look for the file called main.py in the file explorer on the left
  2. Click on it to open it
  3. In the terminal at the bottom of the screen, type:
    python main.py
  4. Press Enter
  5. You should see: Hello, World!

Congratulations! You just ran your first Python program! 🎉

✅ Running Tests

Tests help make sure your code works correctly. You can run tests in two ways:

Option 1: Using the Terminal (Command Line)

  1. In the terminal, type:
    pytest
  2. Press Enter
  3. You should see that tests passed ✓

To see more details about what each test does:

pytest -v

Option 2: Using the Test Explorer (Visual)

  1. Click the beaker/flask icon 🧪 in the left sidebar (Testing)
  2. You'll see a list of all your tests
  3. Click the ▶️ play button next to a test to run it
  4. Green checkmarks ✓ mean the test passed!
  5. This is a great way to see which tests pass and which fail

Tip: The Test Explorer automatically discovers new tests when you save your files!

📁 What's in This Project?

assignment_variables_conditionals/
├── main.py              # Your assignment - complete the 3 steps!
├── tests/               # Tests to check if your code works
│   └── test_main.py     # Tests for your assignment
├── requirements.txt     # Python tools needed
└── README.md           # This file (instructions)

🆘 Need Help?

  • Ask your teacher or classmates
  • Try the code and see what happens - It's okay to make mistakes!
  • Read error messages carefully - They often tell you what's wrong

💡 Tips for Success

  • Save your work often (it auto-saves, but you can also press Ctrl+S or Cmd+S)
  • Run your code frequently to catch mistakes early
  • Start small and build up - don't try to write everything at once
  • If something doesn't work, try reading the error message - it usually gives you a hint!

About

Assignment for working with variables and conditional statements

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages