24 lines
641 B
Python
24 lines
641 B
Python
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
|
|
}
|
|
} |