No—Sri Lanka is not part of Africa.
It is a sovereign island nation in the Indian Ocean, separated from the Indian subcontinent by the Palk Strait (32 km / 20 mi at narrowest). Coordinates: 7°N, 81°E.
Geographic context:
Africa's nearest point (Cape Guardafui, Somalia) is ~3,800 km away. Sri Lanka is culturally, geologically, and politically South Asian—SAARC member, Indo-Aryan/Dravidian heritage, monsoon climate.