Menu

(Solved) : Challenge Activity 324 Creating Named Tuple Define Named Tuple Player Describes Athlete Sp Q44026448 . . .

CHALLENGE ACTIVITY 3.2.4: Creating a named tuple Define a named tuple player that describes an athlete on a sports team. Incl

CHALLENGE ACTIVITY 3.2.4: Creating a named tuple Define a named tuple player that describes an athlete on a sports team. Include the fields name, number, position, and team. 1 from collections import namedtuple HNM L 3 Player = “”! Your solution goes here ! 1 test passed cam = Player(‘Cam Newton’, ‘1’, ‘Quarterback’, ‘Carolina Panthers’) 6 lebron = Player(‘Lebron James’, ’23’, ‘Small forward’, ‘Los Angeles Lakers’) All tests er e n andere one can be eas er to content is passed 8 print(cam.name + ‘(#’ + cam.number + ‘.’ + ‘ is a ‘ + cam. position + ‘ for the ‘ + cam.team + ‘.’) 9 print(lebron.name + ‘(#’ + lebron.number + ‘.’ + ‘ is a ‘ + lebron.position + ‘ for the ‘ + lebron.team + ‘.’). Show transcribed image text CHALLENGE ACTIVITY 3.2.4: Creating a named tuple Define a named tuple player that describes an athlete on a sports team. Include the fields name, number, position, and team. 1 from collections import namedtuple HNM L 3 Player = “”! Your solution goes here ! 1 test passed cam = Player(‘Cam Newton’, ‘1’, ‘Quarterback’, ‘Carolina Panthers’) 6 lebron = Player(‘Lebron James’, ’23’, ‘Small forward’, ‘Los Angeles Lakers’) All tests er e n andere one can be eas er to content is passed 8 print(cam.name + ‘(#’ + cam.number + ‘.’ + ‘ is a ‘ + cam. position + ‘ for the ‘ + cam.team + ‘.’) 9 print(lebron.name + ‘(#’ + lebron.number + ‘.’ + ‘ is a ‘ + lebron.position + ‘ for the ‘ + lebron.team + ‘.’).

Expert Answer


Answer to CHALLENGE ACTIVITY 3.2.4: Creating a named tuple Define a named tuple player that describes an athlete on a sports team….

OR