SlideShare a Scribd company logo
Write a Python program that allows users to keep track of soccer player names and the number
of goals they have scored. The program should consist of three loops for data input and retrieval.
Instructions:
Step 1: Initialization Create two empty lists: one for player names and another for the associated
number of goals.
Step 2: Adding Players and Goals (While Loop) Implement a while loop that continuously
prompts the user for the player's name and appends it to the "player_names" list. During each
iteration of the loop, append a zero to the "goals" list. Allow the user to keep adding players until
they enter 'quit' as the player name. (The loop should exit when 'quit' is entered.) Step 3:
Updating Goals (For Loop)
Calculate the number of players entered.
Implement a for loop that iterates through the player names list.
For each player, display their name and prompt the user to enter the number of goals scored by
that player.
Update the corresponding element in the "goals" list with the inputted number of goals.
Step 4: Displaying Player Stats (Final Loop)
Implement a final loop to display the player names and their associated number of goals, one pair
per line.
Ad

More Related Content

More from sales223546 (11)

Which of the following is a form of market participation A) the.pdf
Which of the following is a form of market participation A) the.pdfWhich of the following is a form of market participation A) the.pdf
Which of the following is a form of market participation A) the.pdf
sales223546
 
Week 6 Class Assessment Implementation Plan for an HRD Learning Int.pdf
Week 6 Class Assessment Implementation Plan for an HRD Learning Int.pdfWeek 6 Class Assessment Implementation Plan for an HRD Learning Int.pdf
Week 6 Class Assessment Implementation Plan for an HRD Learning Int.pdf
sales223546
 
Water restored in parts of Tshwane after two-day outagePretoria - .pdf
Water restored in parts of Tshwane after two-day outagePretoria - .pdfWater restored in parts of Tshwane after two-day outagePretoria - .pdf
Water restored in parts of Tshwane after two-day outagePretoria - .pdf
sales223546
 
Venture Investors Bet AI Can Improve Supply-Chain ManagementLogist.pdf
Venture Investors Bet AI Can Improve Supply-Chain ManagementLogist.pdfVenture Investors Bet AI Can Improve Supply-Chain ManagementLogist.pdf
Venture Investors Bet AI Can Improve Supply-Chain ManagementLogist.pdf
sales223546
 
using draw.io You are tasked with designing a database for a Movie.pdf
using draw.io You are tasked with designing a database for a Movie.pdfusing draw.io You are tasked with designing a database for a Movie.pdf
using draw.io You are tasked with designing a database for a Movie.pdf
sales223546
 
Using jQuery, set up functionality to capture the forms input eleme.pdf
Using jQuery, set up functionality to capture the forms input eleme.pdfUsing jQuery, set up functionality to capture the forms input eleme.pdf
Using jQuery, set up functionality to capture the forms input eleme.pdf
sales223546
 
using draw.io Task 3 Design an ER Diagram for a Library Management .pdf
using draw.io Task 3 Design an ER Diagram for a Library Management .pdfusing draw.io Task 3 Design an ER Diagram for a Library Management .pdf
using draw.io Task 3 Design an ER Diagram for a Library Management .pdf
sales223546
 
using draw.io Task 2 Design an ER Diagram for a Music Streaming.pdf
using draw.io Task 2 Design an ER Diagram for a Music Streaming.pdfusing draw.io Task 2 Design an ER Diagram for a Music Streaming.pdf
using draw.io Task 2 Design an ER Diagram for a Music Streaming.pdf
sales223546
 
UnixLinux 1. Use screen shots or video to demonstrate the before an.pdf
UnixLinux 1. Use screen shots or video to demonstrate the before an.pdfUnixLinux 1. Use screen shots or video to demonstrate the before an.pdf
UnixLinux 1. Use screen shots or video to demonstrate the before an.pdf
sales223546
 
use python Problem 2. Selection Sort In this problem you will implem.pdf
use python Problem 2. Selection Sort In this problem you will implem.pdfuse python Problem 2. Selection Sort In this problem you will implem.pdf
use python Problem 2. Selection Sort In this problem you will implem.pdf
sales223546
 
You are task to add a yawning detection to the programme below;i.pdf
You are task to add a yawning detection to the programme below;i.pdfYou are task to add a yawning detection to the programme below;i.pdf
You are task to add a yawning detection to the programme below;i.pdf
sales223546
 
Which of the following is a form of market participation A) the.pdf
Which of the following is a form of market participation A) the.pdfWhich of the following is a form of market participation A) the.pdf
Which of the following is a form of market participation A) the.pdf
sales223546
 
Week 6 Class Assessment Implementation Plan for an HRD Learning Int.pdf
Week 6 Class Assessment Implementation Plan for an HRD Learning Int.pdfWeek 6 Class Assessment Implementation Plan for an HRD Learning Int.pdf
Week 6 Class Assessment Implementation Plan for an HRD Learning Int.pdf
sales223546
 
Water restored in parts of Tshwane after two-day outagePretoria - .pdf
Water restored in parts of Tshwane after two-day outagePretoria - .pdfWater restored in parts of Tshwane after two-day outagePretoria - .pdf
Water restored in parts of Tshwane after two-day outagePretoria - .pdf
sales223546
 
Venture Investors Bet AI Can Improve Supply-Chain ManagementLogist.pdf
Venture Investors Bet AI Can Improve Supply-Chain ManagementLogist.pdfVenture Investors Bet AI Can Improve Supply-Chain ManagementLogist.pdf
Venture Investors Bet AI Can Improve Supply-Chain ManagementLogist.pdf
sales223546
 
using draw.io You are tasked with designing a database for a Movie.pdf
using draw.io You are tasked with designing a database for a Movie.pdfusing draw.io You are tasked with designing a database for a Movie.pdf
using draw.io You are tasked with designing a database for a Movie.pdf
sales223546
 
Using jQuery, set up functionality to capture the forms input eleme.pdf
Using jQuery, set up functionality to capture the forms input eleme.pdfUsing jQuery, set up functionality to capture the forms input eleme.pdf
Using jQuery, set up functionality to capture the forms input eleme.pdf
sales223546
 
using draw.io Task 3 Design an ER Diagram for a Library Management .pdf
using draw.io Task 3 Design an ER Diagram for a Library Management .pdfusing draw.io Task 3 Design an ER Diagram for a Library Management .pdf
using draw.io Task 3 Design an ER Diagram for a Library Management .pdf
sales223546
 
using draw.io Task 2 Design an ER Diagram for a Music Streaming.pdf
using draw.io Task 2 Design an ER Diagram for a Music Streaming.pdfusing draw.io Task 2 Design an ER Diagram for a Music Streaming.pdf
using draw.io Task 2 Design an ER Diagram for a Music Streaming.pdf
sales223546
 
UnixLinux 1. Use screen shots or video to demonstrate the before an.pdf
UnixLinux 1. Use screen shots or video to demonstrate the before an.pdfUnixLinux 1. Use screen shots or video to demonstrate the before an.pdf
UnixLinux 1. Use screen shots or video to demonstrate the before an.pdf
sales223546
 
use python Problem 2. Selection Sort In this problem you will implem.pdf
use python Problem 2. Selection Sort In this problem you will implem.pdfuse python Problem 2. Selection Sort In this problem you will implem.pdf
use python Problem 2. Selection Sort In this problem you will implem.pdf
sales223546
 
You are task to add a yawning detection to the programme below;i.pdf
You are task to add a yawning detection to the programme below;i.pdfYou are task to add a yawning detection to the programme below;i.pdf
You are task to add a yawning detection to the programme below;i.pdf
sales223546
 

Recently uploaded (20)

ITI monthly test COPA Online Quiz December 2019 PDF
ITI monthly test  COPA Online Quiz December 2019 PDFITI monthly test  COPA Online Quiz December 2019 PDF
ITI monthly test COPA Online Quiz December 2019 PDF
SONU HEETSON
 
The Board Doesn’t Care About Your Roadmap: Running Product at the Board
The Board Doesn’t Care About Your Roadmap: Running Product at the BoardThe Board Doesn’t Care About Your Roadmap: Running Product at the Board
The Board Doesn’t Care About Your Roadmap: Running Product at the Board
victoriamangiantini1
 
Online elections for Parliament for European Union
Online elections for Parliament for European UnionOnline elections for Parliament for European Union
Online elections for Parliament for European Union
Monica Enache
 
Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025
Mebane Rash
 
Product in Wartime: How to Build When the Market Is Against You
Product in Wartime: How to Build When the Market Is Against YouProduct in Wartime: How to Build When the Market Is Against You
Product in Wartime: How to Build When the Market Is Against You
victoriamangiantini1
 
Management of head injury in children.pdf
Management of head injury in children.pdfManagement of head injury in children.pdf
Management of head injury in children.pdf
sachin7989
 
Quality Assurance and Quality Management, B. Pharm 6th Semester-Unit-1
Quality Assurance and Quality Management, B. Pharm 6th Semester-Unit-1Quality Assurance and Quality Management, B. Pharm 6th Semester-Unit-1
Quality Assurance and Quality Management, B. Pharm 6th Semester-Unit-1
Amit Kumar Sahoo
 
Leveraging AI to Streamline Operations for Nonprofits [05.20.2025].pdf
Leveraging AI to Streamline Operations for Nonprofits [05.20.2025].pdfLeveraging AI to Streamline Operations for Nonprofits [05.20.2025].pdf
Leveraging AI to Streamline Operations for Nonprofits [05.20.2025].pdf
TechSoup
 
TechSoup Introduction to Generative AI and Copilot - 2025.05.22.pdf
TechSoup Introduction to Generative AI and Copilot - 2025.05.22.pdfTechSoup Introduction to Generative AI and Copilot - 2025.05.22.pdf
TechSoup Introduction to Generative AI and Copilot - 2025.05.22.pdf
TechSoup
 
EUPHORIA GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025EUPHORIA GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
EUPHORIA GENERAL QUIZ PRELIMS | QUIZ CLUB OF PSGCAS | 21 MARCH 2025
Quiz Club of PSG College of Arts & Science
 
AI and international projects. Helsinki 20.5.25
AI and international projects. Helsinki 20.5.25AI and international projects. Helsinki 20.5.25
AI and international projects. Helsinki 20.5.25
Matleena Laakso
 
Maslows Toolbox - Inclusive Classrooms.pptx
Maslows Toolbox - Inclusive Classrooms.pptxMaslows Toolbox - Inclusive Classrooms.pptx
Maslows Toolbox - Inclusive Classrooms.pptx
Pooky Knightsmith
 
Intervene with Precision: Zooming In as a Leader Without Micromanaging
Intervene with Precision: Zooming In as a Leader Without MicromanagingIntervene with Precision: Zooming In as a Leader Without Micromanaging
Intervene with Precision: Zooming In as a Leader Without Micromanaging
victoriamangiantini1
 
LDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDMMIA 2024 Crystal Gold Lecture 1 BonusLDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDM & Mia eStudios
 
NA FASE REGIONAL DO TL – 1.º CICLO. .
NA FASE REGIONAL DO TL – 1.º CICLO.     .NA FASE REGIONAL DO TL – 1.º CICLO.     .
NA FASE REGIONAL DO TL – 1.º CICLO. .
Colégio Santa Teresinha
 
materi 3D Augmented Reality dengan assemblr
materi 3D Augmented Reality dengan assemblrmateri 3D Augmented Reality dengan assemblr
materi 3D Augmented Reality dengan assemblr
fatikhatunnajikhah1
 
Automated Actions (Automation) in the Odoo 18
Automated Actions (Automation) in the Odoo 18Automated Actions (Automation) in the Odoo 18
Automated Actions (Automation) in the Odoo 18
Celine George
 
Presentation on Career Opportunities in Reservation and Air Ticketing By Md ...
Presentation on Career Opportunities  in Reservation and Air Ticketing By Md ...Presentation on Career Opportunities  in Reservation and Air Ticketing By Md ...
Presentation on Career Opportunities in Reservation and Air Ticketing By Md ...
Md Shaifullar Rabbi
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
TechSoup - Microsoft Discontinuation of Selected Cloud Donated Offers 2025.05...
TechSoup - Microsoft Discontinuation of Selected Cloud Donated Offers 2025.05...TechSoup - Microsoft Discontinuation of Selected Cloud Donated Offers 2025.05...
TechSoup - Microsoft Discontinuation of Selected Cloud Donated Offers 2025.05...
TechSoup
 
ITI monthly test COPA Online Quiz December 2019 PDF
ITI monthly test  COPA Online Quiz December 2019 PDFITI monthly test  COPA Online Quiz December 2019 PDF
ITI monthly test COPA Online Quiz December 2019 PDF
SONU HEETSON
 
The Board Doesn’t Care About Your Roadmap: Running Product at the Board
The Board Doesn’t Care About Your Roadmap: Running Product at the BoardThe Board Doesn’t Care About Your Roadmap: Running Product at the Board
The Board Doesn’t Care About Your Roadmap: Running Product at the Board
victoriamangiantini1
 
Online elections for Parliament for European Union
Online elections for Parliament for European UnionOnline elections for Parliament for European Union
Online elections for Parliament for European Union
Monica Enache
 
Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025Statement by Linda McMahon on May 21, 2025
Statement by Linda McMahon on May 21, 2025
Mebane Rash
 
Product in Wartime: How to Build When the Market Is Against You
Product in Wartime: How to Build When the Market Is Against YouProduct in Wartime: How to Build When the Market Is Against You
Product in Wartime: How to Build When the Market Is Against You
victoriamangiantini1
 
Management of head injury in children.pdf
Management of head injury in children.pdfManagement of head injury in children.pdf
Management of head injury in children.pdf
sachin7989
 
Quality Assurance and Quality Management, B. Pharm 6th Semester-Unit-1
Quality Assurance and Quality Management, B. Pharm 6th Semester-Unit-1Quality Assurance and Quality Management, B. Pharm 6th Semester-Unit-1
Quality Assurance and Quality Management, B. Pharm 6th Semester-Unit-1
Amit Kumar Sahoo
 
Leveraging AI to Streamline Operations for Nonprofits [05.20.2025].pdf
Leveraging AI to Streamline Operations for Nonprofits [05.20.2025].pdfLeveraging AI to Streamline Operations for Nonprofits [05.20.2025].pdf
Leveraging AI to Streamline Operations for Nonprofits [05.20.2025].pdf
TechSoup
 
TechSoup Introduction to Generative AI and Copilot - 2025.05.22.pdf
TechSoup Introduction to Generative AI and Copilot - 2025.05.22.pdfTechSoup Introduction to Generative AI and Copilot - 2025.05.22.pdf
TechSoup Introduction to Generative AI and Copilot - 2025.05.22.pdf
TechSoup
 
AI and international projects. Helsinki 20.5.25
AI and international projects. Helsinki 20.5.25AI and international projects. Helsinki 20.5.25
AI and international projects. Helsinki 20.5.25
Matleena Laakso
 
Maslows Toolbox - Inclusive Classrooms.pptx
Maslows Toolbox - Inclusive Classrooms.pptxMaslows Toolbox - Inclusive Classrooms.pptx
Maslows Toolbox - Inclusive Classrooms.pptx
Pooky Knightsmith
 
Intervene with Precision: Zooming In as a Leader Without Micromanaging
Intervene with Precision: Zooming In as a Leader Without MicromanagingIntervene with Precision: Zooming In as a Leader Without Micromanaging
Intervene with Precision: Zooming In as a Leader Without Micromanaging
victoriamangiantini1
 
LDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDMMIA 2024 Crystal Gold Lecture 1 BonusLDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDMMIA 2024 Crystal Gold Lecture 1 Bonus
LDM & Mia eStudios
 
materi 3D Augmented Reality dengan assemblr
materi 3D Augmented Reality dengan assemblrmateri 3D Augmented Reality dengan assemblr
materi 3D Augmented Reality dengan assemblr
fatikhatunnajikhah1
 
Automated Actions (Automation) in the Odoo 18
Automated Actions (Automation) in the Odoo 18Automated Actions (Automation) in the Odoo 18
Automated Actions (Automation) in the Odoo 18
Celine George
 
Presentation on Career Opportunities in Reservation and Air Ticketing By Md ...
Presentation on Career Opportunities  in Reservation and Air Ticketing By Md ...Presentation on Career Opportunities  in Reservation and Air Ticketing By Md ...
Presentation on Career Opportunities in Reservation and Air Ticketing By Md ...
Md Shaifullar Rabbi
 
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFAMCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
MCQS (EMERGENCY NURSING) DR. NASIR MUSTAFA
Dr. Nasir Mustafa
 
TechSoup - Microsoft Discontinuation of Selected Cloud Donated Offers 2025.05...
TechSoup - Microsoft Discontinuation of Selected Cloud Donated Offers 2025.05...TechSoup - Microsoft Discontinuation of Selected Cloud Donated Offers 2025.05...
TechSoup - Microsoft Discontinuation of Selected Cloud Donated Offers 2025.05...
TechSoup
 
Ad

Write a Python program that allows users to keep track of soccer pla.pdf

  • 1. Write a Python program that allows users to keep track of soccer player names and the number of goals they have scored. The program should consist of three loops for data input and retrieval. Instructions: Step 1: Initialization Create two empty lists: one for player names and another for the associated number of goals. Step 2: Adding Players and Goals (While Loop) Implement a while loop that continuously prompts the user for the player's name and appends it to the "player_names" list. During each iteration of the loop, append a zero to the "goals" list. Allow the user to keep adding players until they enter 'quit' as the player name. (The loop should exit when 'quit' is entered.) Step 3: Updating Goals (For Loop) Calculate the number of players entered. Implement a for loop that iterates through the player names list. For each player, display their name and prompt the user to enter the number of goals scored by that player. Update the corresponding element in the "goals" list with the inputted number of goals. Step 4: Displaying Player Stats (Final Loop) Implement a final loop to display the player names and their associated number of goals, one pair per line.
  翻译: