Question: As a software engineer, you are hired to arrange football players based on their cauntry and position. You have given all the player's information in a tuple called my_tuple. The players are fram 3 countries which are Brazi, Argentina and Germany. They are 2 positions which are "Farward" and "Midfield" You are given the following nested tuple where each element in the my_tuple is a tuple consisting of a name and a 4 digit ID. my_tuple = (("Firmina", 1101).("Gabriel", 1201).("Casemiro", 1302).("Fred", 1402)"Messi", 111).("Aguero", 1211)"Klose", 1121), (Werner", 1221), ("Tani", 1322)) Write a python program that will conVert this tuple into the fallowing dictionary using the process described below: Your code shauld work for al types of similar tuple if the sample input is changed. Output dictionary (You just have to print the resultant dictionary. No need to follow the pattern bekow) 'Forward': Brazil: (Firmino', "Gabriel). "Argentina': (Mesni, "Aguero'), "Germany: (Klose', Werner) "Midfielder: Brazil: (Casemiro', Fred') Germany: Tani Here yau need to convert the given tuple into the output using the 4 digit ID. The rules are given below: 1==> Last digit of the ID represents the position. Here 1a-> 1 means Farward 1b-> 2 means Midfield 2==> Third digit af the ID represents the country. Here 2a-> 0 means Brazil 26-> 1 means Argentina 20-> 2 means Germany 3==> If you have muliple players in a category use tuple to stare the multiple names as the value of the nested dictionary 4==> If any country has no player af a particular pasition, that country name should not appear as a key in the nested dictionary of that particular position. For example, Argentina has no midfielder. Sa Argentina did nat appear under the "Midfield" position. 5==> If your output dictionary's key value pair sequence is nat the same as the shown output you shauld not warry about that. However, the key value pair should be exactly the same

COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
1st Edition
ISBN:9780357392676
Author:FREUND, Steven
Publisher:FREUND, Steven
Chapter8: Working With Trendlines, Pivottables, Pivotcharts, And Slicers
Section: Chapter Questions
Problem 8EYW
icon
Related questions
Question

In Python Asap pls

 

Question:
As a software engineer, you are hired to arrange football players based on
their cauntry and position. You have given all the player's information in
a tuple called my_tuple. The players are fram 3 countries which are Brazi,
Argentina and Germany. They are 2 positions which are "Farward" and
"Midfield"
You are given the following nested tuple where each element in the my_tuple
is a tuple consisting of a name and a 4 digit ID.
my_tuple = ("Firnino", 1101).(Gabriel", 1201).("Casemiro", 1302).("Fred",
1402)("Mess", 1111).("Aguero", 1211)M"Klase", 1121). ("Werner", 1221),
("Tani", 1322))
Write a python program that will conVert this tuple into the fallowing
dictionary using the process described below. Your code shauld work for al
types of similar tuple if the sample input is changed.
Output dictionary (Yau just have to print the resultant dictionary. No need
to follow the pattern below)
'Forward':
Brazil: (Firmino', 'Gabriel).
"Argentina': ('Messi, "Aguero'),
"Germany: (Klose', Werner')
"Midfielder":
Brazil: (Casemiro', Fred')
Germany: Tani
Here yau need to convert the given tuple into the output using the 4 digit
ID. The rules are given belaw:
1==> Last digit of the ID represents the position. Here
1a->1 means Farward
1b-> 2 means Midfield
2==> Third digit af the ID represents the country. Here
2a-> 0 means Brazil
26-> 1 means Argentina
20-> 2 means Germany
3==> If you have multiple players in a category use tuple to stare the
multiple names as the value af the nested dictionary
4==> If any country has no player af a particular pasition, that country
name should not appear as a key in the nested dictionary af that particular
position. For example, Argentina has no midfielder. So Argentina did nat
appear under the "Midfield" position.
5==> If your output dictionary's key value pair sequence is nat the same as
the shown output you shauld not warry about that. However, the key value
pair should be exactly the same
Transcribed Image Text:Question: As a software engineer, you are hired to arrange football players based on their cauntry and position. You have given all the player's information in a tuple called my_tuple. The players are fram 3 countries which are Brazi, Argentina and Germany. They are 2 positions which are "Farward" and "Midfield" You are given the following nested tuple where each element in the my_tuple is a tuple consisting of a name and a 4 digit ID. my_tuple = ("Firnino", 1101).(Gabriel", 1201).("Casemiro", 1302).("Fred", 1402)("Mess", 1111).("Aguero", 1211)M"Klase", 1121). ("Werner", 1221), ("Tani", 1322)) Write a python program that will conVert this tuple into the fallowing dictionary using the process described below. Your code shauld work for al types of similar tuple if the sample input is changed. Output dictionary (Yau just have to print the resultant dictionary. No need to follow the pattern below) 'Forward': Brazil: (Firmino', 'Gabriel). "Argentina': ('Messi, "Aguero'), "Germany: (Klose', Werner') "Midfielder": Brazil: (Casemiro', Fred') Germany: Tani Here yau need to convert the given tuple into the output using the 4 digit ID. The rules are given belaw: 1==> Last digit of the ID represents the position. Here 1a->1 means Farward 1b-> 2 means Midfield 2==> Third digit af the ID represents the country. Here 2a-> 0 means Brazil 26-> 1 means Argentina 20-> 2 means Germany 3==> If you have multiple players in a category use tuple to stare the multiple names as the value af the nested dictionary 4==> If any country has no player af a particular pasition, that country name should not appear as a key in the nested dictionary af that particular position. For example, Argentina has no midfielder. So Argentina did nat appear under the "Midfield" position. 5==> If your output dictionary's key value pair sequence is nat the same as the shown output you shauld not warry about that. However, the key value pair should be exactly the same
Expert Solution
steps

Step by step

Solved in 3 steps with 3 images

Blurred answer
Knowledge Booster
Elements of Tables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning