Update code in endpoints/wahtsup.get.py

This commit is contained in:
Backend IM Bot 2025-03-21 05:25:05 +00:00
parent d33ae0cb8f
commit 6de50164fb

View File

@ -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
}
}