Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions presentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,15 @@ The `presentation` directory contains the following supporting files for the pre

The `examples/` directory contains the following example code files:

- `example1.py`: Demonstrates a feature of GitHub Copilot Workspace.
- `example2.py`: Demonstrates another feature of GitHub Copilot Workspace.
- `math_operations/example1.py`: Demonstrates a feature of GitHub Copilot Workspace.
- `greetings/example2.py`: Demonstrates another feature of GitHub Copilot Workspace.

## Subdirectories

The `examples/` directory is organized into the following subdirectories:

- `math_operations/`: Contains example code files related to mathematical operations.
- `greetings/`: Contains example code files related to greeting messages.

Feel free to modify and experiment with the example code files to better understand how GitHub Copilot Workspace can assist you in your development workflow.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# Example 2: Demonstrating another feature of GitHub Copilot Workspace

def greet(name):
def greet(name: str) -> str:
"""
Function to greet a person by name.
"""
return f"Hello, {name}!"

def farewell(name):
def farewell(name: str) -> str:
"""
Function to bid farewell to a person by name.
"""
return f"Goodbye, {name}!"

def main():
def main(name: str):
"""
Main function to demonstrate greeting and farewell.
"""
name = "Alice"
print(greet(name))
print(farewell(name))

if __name__ == "__main__":
main()
main("Alice")
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
# Example 1: Demonstrating a feature of GitHub Copilot Workspace

def add(a, b):
def add(a: float, b: float) -> float:
"""
Function to add two numbers.
"""
return a + b

def subtract(a, b):
def subtract(a: float, b: float) -> float:
"""
Function to subtract two numbers.
"""
return a - b

def multiply(a, b):
def multiply(a: float, b: float) -> float:
"""
Function to multiply two numbers.
"""
return a * b

def divide(a, b):
def divide(a: float, b: float) -> float:
"""
Function to divide two numbers.
"""
if b == 0:
raise ValueError("Cannot divide by zero")
return a / b
try:
return a / b
except ZeroDivisionError:
return float('inf')

if __name__ == "__main__":
x = 10
Expand Down