In recent years, several metaheuristic algorithms have been introduced in engineering and scientific fields to address real-life optimization problems. In this study, a novel nature-inspired metaheuristics algorithm named as Snake Optimizer (SO) is proposed to tackle a various set of optimization tasks which imitates the special mating behavior of snakes. Each snake (male/female) fights to have the best partner if the existed quantity of food is enough and the temperature is low. This study mathematically mimics and models such foraging and reproduction behaviors and patterns to present a simple and efficient optimization algorithm. To verify the validity and superiority of the proposed method, SO is tested on 29 unconstrained Congress on Evolutionary Computation (CEC) 2017 benchmark functions and four constrained real-world engineering problems. SO is compared with other 9 well-known and newly developed algorithms such as Linear population size reduction- Success-History Adaptation for Differential Evolution (L-SHADE), Ensemble Sinusoidal incorporated with L-SHADE (LSHADE-EpSin), Covariance matrix adaptation evolution strategy (CMAES), Coyote Optimization Algorithm (COA), Moth-flame Optimization, Harris Hawks Optimizer, Thermal Exchange optimization, Grasshopper Optimization Algorithm, and Whale Optimization Algorithm. Experimental results and statistical comparisons prove the effectiveness and efficiency of SO on different landscapes with respect to exploration-exploitation balance and convergence curve speed.