CodeSolved

Solved Programming Questions & Exercises

Calculate the football team points

Practice Easy 1626/ Download 2335 Views

You will be given the score of a team that has won the Premier League at the entrance and you are printing the team's scores along with the number of wins this season at the output.

The team will play 2 games, so you will be given 2 points. For each team game either zero scored or one or three points. The team will score three points in the event of a zero -point loss, in the event of a draw.

Sample Input:

3 3
3 3
3 0
0 0
0 0
1 1
1 1
1 3
3 3
3 3
0 0
0 0
0 1
1 1
1 1

13 Answers

This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
This answer is only visible to premium members
This answer is only visible to premium members
This answer is only visible to premium members
let msg = 'error'
alert(msg) 
This answer is only visible to premium members
This answer is only visible to premium members

This answer is only visible to premium members

Subscription is currently unavailable.
from random import *
sum = 0
for i in range(1,16):
    golus = randint(0,3)
    golthey = randint(0,3)

    if golus == golthey:
        point = 1
        sum += point
    elif golus < golthey:
        point = 0
    else:
        point = 3
        sum += point

    print(golus,"_", golthey , "point=",point) \
print("sum points =",sum)

User 3382 Download Python
points = []
for _ in range(15):
    points.append(int(input().strip()))

total_points = sum(points)
wins = points.count(3)

print(total_points, wins)
Ai Download Python
team1=[3,3,3,0,0,1,1,1,3,3,0,0,0,1,1]
team2=[3,3,0,0,0,1,1,3,3,3,0,0,1,1,1]                    
victory_team1=0
victory_team2=0
def victory(a,b):
    global victory_team2,victory_team1
    for tem1,tem2 in zip(a,b):
        if tem1 == 3:
            victory_team1+=1
        if tem2 == 3:
            victory_team2+=1
victory(team1,team2)

print(f"team score1: {sum(team1)}")
print(f"team victories1: {victory_team1}")
print("----------------------")
print(f"team score2: {sum(team2)}")
print(f"team victories2: {victory_team2}")
team1 = [3,3,3,0,0,1,1,1,3,3,0,0,0,1,1]
team2 = [3,3,0,0,0,1,1,3,3,3,0,0,1,1,1]

def football(x):
    sum = 0
    count = 0

    for i in x:
        sum += i
        if i == 3:
            count += 1

    print("Total points = ",sum)
    print("Number of wins = ",count)

football(team1)
football(team2)
v,b=0,0
for i in range(15):
   x = int(input("enter :"))
   v = v + x
   if(x==3):
       b=b+1
print(b)
print(v)
Kordawan Download Python
v,n,b=0,0,0
for i in range(15):
   x = int(input("enter :"))
   if(x==3)or(x==1)or(x==0):
     v = v + x
     if(x==3):
         b=b+1
   else:
       print("eruor")
       n=1
       break
if(n==0):
  print(b)
  print(v)
Kordawan Download Python
input_choice = ["0","1","3"]
score_input = "1,1,1,3,3,3,3"
scores_list = score_input.split(",")
scores = []
win = 0

for score in scores_list:
    if score in input_choice:
        score = int(score)
        scores.append(score)
        if score == 3:
            win += 1
    else:
        print("Value is Not Valide")

print(f"Your Scores is : {sum(scores)}")
print(f"The Number Of Win is : {win}")

User 3542 Download Python
<< Previous page 1 2 Next page >>

Submit answer

Submitting answers is currently unavailable.

×
×
Close