Check out example codes for "2020 election live". It will help you in understanding the concepts better.

Code Example 1

Only half of Alaska seem to mind

Code Example 2

if trumpWin:
	print("we're fucked ._.")
    world.isEnding = true
elif bidenWin:
	print("trump is an old orange ;-;")
    world.isEnding = false

Code Example 3

void Start()
{
	Console.Writeline("This is spoopy!");
}

Code Example 4

I will be voting for the Mario Party

Code Example 5

Biden!!!!!!

Code Example 6

public class Election2020 {

  	public static void main(String[] args) {
    	whoWins();
    }
  
	public static void whoWins() {
    	Candidate biden = new Candidate("Biden", 72011200);
    	Candidate trump = new Candidate("Trump", 68568896);
      		if(biden.getVotes() > trump.getVotes()) {
        		biden.setDoesWin(true);
       	 	} else if(trump.getVotes() > biden.getVotes()) {
        		trump.setDoesWin(true);
        	}
			if(biden.getDoesWin() == true && trump.getDoesWin() == false) {
				System.out.println("Yes");
			} else if(trump.getDoesWin() == true && biden.getDoesWin() == false) {
				System.out.println("no");
			}
	}
}

public class Candidate {
	public int votes;
  	public String name;
  	public boolean doesWin;
  	public Candidate(String name, int votes) {
     	this.name = name;
      	this.votes = votes;
    }
  	
  	public int getVotes() {
     	return votes; 
    }
  	
  	public void setDoesWin(boolean doesWin) {
    	this.doesWin = doesWin;
    }
  
  	public boolean getDoesWin() {
    	return doesWin;
    }
}

Learn ReactJs, React Native from akashmittal.com