Hello, World!

CDS1010: Week 0
Wiedemann • Fall 2025

Programming Environment

  • Explorer: Sidebar for managing files and folders.
  • Editor: Area to read, write, and edit code files.
  • Terminal: Interface for running commands, such as
    code FILENAME.py
    to open (/create) a file in the editor, or
    python FILENAME.py
    to run the Python interpreter on the file.

Variables

  • Variable: Named reference to a value stored in memory.
  • Assignment operator (=): Stores the value on the right into the variable on the left; e.g., num = 10 stores the value 10 into the variable num.

Functions

  • Function: Named block of code that can be called to perform a specific task. May take arguments, produce side effects, and/or return values.
  • Argument: Any value passed to a function.
  • Side effect: Any effect of a function other than its return value.
  • Return value: Any data a function outputs after execution.

Examples

print("Hello, World!")

The argument "Hello, World!" is passed into the function print(), which produces the side effect of displaying the text to the screen.


name = input("What is your name? ")

The argument "What is your name?" is passed into the function input(), which produces the side effect of prompting the user; the user input is returned and saved into the variable name.

Strings

  • String (str): Sequence of characters; e.g., "Hello".
  • String concatenation: Using the + operator to concatenate strings; e.g., "Hello, " + "World".
  • Method: Function that belongs to an object, called with dot syntax; e.g., " Hello ".strip().
  • Methods to know: .capitalize(), .center(), .count(), .lower(), .replace(), .strip(), .title(), .upper()

Integers

  • Integer (int): Whole number; e.g., 42, 0, -15.
  • Arithmetic operators: Symbols for mathematical operations; e.g., + (addition), - (subtraction), * (multiplication), / (division).

Miscellaneous Vocabulary

  • Comment (#): Inline note ignored by Python.
  • Data Type: Classification of values; e.g., str, int
  • Type casting / conversion: Changing a value from one type to another; e.g., int() can be used to convert a str to an int.
  • Nested call: Using the return of one function directly as the argument of another; e.g., int(input(...)).