r/pythonhelp • • May 02 '21

HOMEWORK creating a game help?

For my homework I'm tasked with creating a fantasy league,

The functionality required from this project is:
- Allow the user to choose an unlimited number of teams
- Allow the user to choose players for those teams
- Allow the user to choose an unlimited number of games
- Report the team scores after those games have been played

This is my code so far:

import random
def main():
	print("You need to call your functions here from above") 
	# func_name()
if __name__ == '__main__':
	main()
 
team_size = {}
while True:
    team_name = input('enter a team name\n>')
         team_size.setdefault(team_name,0)

I have two questions. Does the code above hit the first three tick marks? Can someone give me a hint on how to report scores?

Any help is appreciated!!!!

2 Upvotes

8 comments sorted by

View all comments

Show parent comments

1

u/[deleted] May 02 '21

[removed] — view removed comment

1

u/Puzzled_Farmer_63 May 06 '21
import random

print("Welcom to the Goofball Fantasy League!")

Teams - []
Players = []

X = 0
X  += 1

def Teams_playing():
  Team_num = input("How many teams are playing this season?:")
for Team in range(int(Team_num)):
  Team_name = input("Enter the name of team" + str(x) + ": ")
  Team.append(Team_name)
  Team_playing()

  # Comme back to fix numbers to automatically follow each iteration
  
  def Num_players():
    Team_num = input("How many players are there per team?:")
    for 1 in range(len(Teams)): 
   for Player in rang(int(Players_num)):
    Players_name = input("Enter player name for team" + Teams[i] + ": ")
Players.append(Players_name)
Num_players()

def Season_games():
  Seasons= input("How many games are in the season?:")
  Scores = random.randit(0,3)
  for Season in range(int(Seasons)):

    # Figure out how to set this up

    Season_games()






    
def main():
	print("You need to call your functions here from above") 
	# func_name()

if __name__ == '__main__':
	main()

Hi. This is what I was able to come up with thus far. Im writing to see if you could help me write a function that would report the score of the game?

1

u/[deleted] May 06 '21

[removed] — view removed comment

1

u/Puzzled_Farmer_63 May 06 '21

No sorry I’m writing this code my self for a project for a beginners coding class. But thanks anyway for your help already friend :)