Hey Shivani,
Karnataka is vast and the weather differs from place to place. If you're planning to visit North Karnataka (Hampi, Badami etc.) then October end to February would be a good time as it can get very humid during the summer months. Other places such as Coorg, Mysore, Chikmagalur, Bangalore are great to visit throughout the year due to their consistent pleasant weather.