It is best to release the snake outdoors into the environment.
Snakes occasionally wander into basements. Prevent this from occurring by caulking all openings around the house, especially windows and doors. To discourage snakes from living close to your house, remove stacks of firewood, leaves or other debris from near the home. Snakes like to hide in dense vegetation and debris. When working in areas where copperheads and rattlesnakes are found, wear gloves when moving logs, rock or underbrush. https://extension.umd.edu/hgic/topics/snakes