Back to List

Hello World Experiment

This is the simplest Python experiment. You can enter your name and the program will greet you.

Python Code:
def hello(name: str) -> str:
    """Greet the specified person"""
    return f"Hello, {name}!"

# Usage Example
result = hello("World")
print(result)  # Output: Hello, World!
Try it out:
🔗 Backend API Calls
💡 Learning Points:
  • Function Definition: Use def keyword to define a function

  • Type Annotation: name: str and -> str provide type hints

  • f-string: Use f"" for string formatting

  • API Call: Click "Call API" button sends requests to the FastAPI backend

  • Next.js API Routes: Click "Call Next.js API" button calls Next.js API within the same project, demonstrating full-stack development