From 6de50164fb698ffe82c32d699c5f829e76d79d1f Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 21 Mar 2025 05:25:05 +0000 Subject: [PATCH] Update code in endpoints/wahtsup.get.py --- endpoints/wahtsup.get.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/endpoints/wahtsup.get.py b/endpoints/wahtsup.get.py index e69de29..445e930 100644 --- a/endpoints/wahtsup.get.py +++ b/endpoints/wahtsup.get.py @@ -0,0 +1,24 @@ +from fastapi import APIRouter +import random + +african_countries = [ + "Nigeria", "Egypt", "South Africa", "Kenya", "Ethiopia", + "Ghana", "Morocco", "Tanzania", "Uganda", "Algeria", + "Sudan", "Angola", "Mali", "Senegal", "Rwanda" +] + +router = APIRouter() + +@router.get("/wahtsup") +async def get_random_countries(): + """Return random African countries""" + selected = random.sample(african_countries, k=3) + + return { + "message": "Random African countries retrieved", + "countries": selected, + "features": { + "total_available": len(african_countries), + "sample_size": 3 + } + } \ No newline at end of file