codingdirectional: Counts the points of our team in the championship

Hello and today we will continue to solve the problem posted on codewars, if you have not yet joined codewars then I really encourage you to do so because this site is a real deal for those of you who want to master the Python programming language. In this latest chapter, we will need to write a function that takes such a list and counts the points of our football team in the championship. Rules for counting points for each match are as follows.

  1. if x>y – 3 points
  2. if x<y – 0 point
  3. if x=y – 1 point

We will first split the items in a list into two parts, then we will compare the first part with the second part and add up the points accordingly.

 def points(games):          total = 0     for points in games:         c_point = points.split(':')         if(int(c_point[0]) > int(c_point[1])):             total += 3         elif(int(c_point[0]) == int(c_point[1])):             total += 1      return total 

The solution is short and simple, if you have a better solution then do comment on the below tweet so others can learn from you as well.

Planet Python

gamingdirectional: Increase the points that need to win the game

What is up buddy? In this article, we will continue to edit our pygame project by increasing the difficulty to win this game. 1) We will increase the points that we need to win the game by double. 2) We will also increase the damage points to 3 instead of 1 when the player gets hit by the missile from the horizontal moving enemy ship. We only need to update one file to make those changes…

Source

Planet Python