Political parties increasingly rely on social media platforms like Twitter and Facebook for political communication. Elections play crucial role in all democracies and social media is an important aspect in this process. The Obama administration used sentiment analysis to gauge public opinion to policy announcements and campaign messages ahead of 2012 presidential election. By combining multiple techniques the proposed model for predicting electoral outcomes was also effective for candidates and parties having small vote count. In this article we will discuss about how we can use a method called sentiment analysis for predicting elections using data acquired from twitter.