Skip to content

Latest commit

 

History

History
80 lines (52 loc) · 1.7 KB

warm_up.md

File metadata and controls

80 lines (52 loc) · 1.7 KB

Let's do some warm up

Now we will run a very basic Python program that will print Hello WomenWhoCode!. This will allow you to run a basic Python program:

  • from the terminal
  • from your editor

Copy sample file

Please copy the sample file below and save as first_python_code.py.

first_python_code.py

Run your first Python program

Let's try to run some Python code!

Using a terminal

  • Open a terminal
Windows: Click Start -> Type cmd
Mac: Open Applications folder -> Utilities folder
  • Go to the directory of the file by running the following command. If you need help finding the directory path, you can ask the mentor how.
cd <path to your copy of first_python_code>
  • Run our first_python_code.py by typing the following command.
python first_python_code.py

or

python3 first_python_code.py
  • This is your simple program that prints some text. The output should be
Hello WomenWhoCode!
Hello WomanWhoCode!
Hello WomenWhoCode!

Using an editor

Open the file using your text editor and run the code! You should see the same result.

Try printing your name

  • Open the file using your text editor.
  • Inside the file, there is an instruction. Follow it! :)
  • When you are done, save the file and run it again in your terminal and editor!
Hello WomenWhoCode!
Hello WomanWhoCode!
Hello WomenWhoCode!
Nicole loves Python!

Now you have run your first program!

Put your thinking cap on!

  • What is the extension of a Python file?
  • What do you call the cd? What does it do?
  • What does the print() do?
  • What does the .format() do?
  • What is the magic of the # symbol?