Home / Expert Answers / Computer Science / code-in-python-nbsp-below-is-what-the-text-file-says-you-will-have-to-input-the-names-into-pa672

(Solved): Code in python   Below is what the text file says (You will have to input the names into ...



Code in python

Please read the following about passing a function as an argument.
\# A function name can work as a variable name that can be

3. Download names.txt from Canvas and place the file in the hw \( 7 p 3 \) package.
4. Add a module named lambdafunc.py and d

 

Below is what the text file says (You will have to input the names into a text file to put it into the python file):

Alex Briesemeister
Marcus Buehler
Shawn Buesgens
Benjamin Bulman
Matthew Chenery
Spencer Chenoweth
Riley Collins
Steven Colliton
Jaclyn Daub
Jennifer Degen
Samantha Dejoy
Ross Dembsky
Korey Dropkin
Biancca Dufour
Alex Eatherton
Ryan Ebhardt
Christopher Eckhoff
Jeffrey Erdmann
Marina Falcon
Joel Farkas
Darion Fletcher
Maxwell Forster
Adam Fox
Benjamim Freemark
Parker Fuchs
Jack Furlong
Teagan Geissler-Knowlton
Nathan Germscheid
Jennifer Goeman
Abigail Gordon
Elizabeth Gregory
Megan Griss
Brandi Guarneri
Travis Hagerman
Andrew Hamlin
Carly Hanson
Jonathan Harden
Haley Haroldson
David Hautamaki
Nikolas Heyworth
Kaitlyn Hiebert
Ariana Hills
Hope Hollasch
Samuel Hosszu
Molly Hunter
Laura Ichimura
Nathan Jack
Alexander Johnson
Kelsie Johnson
Zekeill Johnson
Junoh Jung
Molly Kalla
Connor Kanuit
Kelten Kelly
Matthew Klemetsen
Ethan Knutson
Molly Knutson
Courtney Koenig
Bailey Kolles
Emily LaCount
Jennifer Lano
Emily Lieske
Jordan Loken
Casey Lomen
Willie Lyon
Kyle Martinson
Max McMahon
Jordan Melby
John Mitchell
Chandler Moser
Katalina Moua
Daniel Myrant
Mitchell Newton
Reine Nguyen
Christina Nibbe
Felisha Nordby
Katherine Northouse
Samantha Ortiz
Daniel Petrill
Samuel Plummer
Mary Pruitt
Jack Radford
Dominic Ricci
Dylan Rocklin
Abigail Savolt
Krista Schmitz
Angela Schroeder
Zachary Schwartz
Tori Seymour
Cole Small
Benjamin Smude
David Spagnolo
Elizabeth Spicer
Natalie Stauber
Ryan Stewart
William Stover
Anthony Tabery
Amy Terrio
Daniel Thielman
Patrick Ubel
Erik Vaughn
Irina Vickstrom
Nicholas Vittorio
Caitlin Wahouske
William Westerman
Christopher Westin
Alexandra White
Noah White
Tiffany Worgren
Austyn Young
Stefanie Ziebell

Please read the following about passing a function as an argument. \# A function name can work as a variable name that can be passed \# into another function as its argument. def add_them \( (x, y) \) : return \( x+y \) def sub_them \( (x, y) \) : return \( x-y \) \# This function takes another function as its first argument. def use_funcs(func, \( x, y \) ): \# Execute the func with two parameters, here, \( x \) and \( y \) \# and returns the results return func \( (x, y) \) print(use_funcs(add_them, 3, 2)) \# Output: 5 print(use_funcs(sub_them,3,2)) \# Output: 1 \# We can also pass a Lambda function as argument. print(use_funcs(lambda \( \left.x, y: x^{*} y, 3,2\right) \) ) \# Output: 6 Add a new package named hw7p3 to the src folder. 3. Download names.txt from Canvas and place the file in the hw \( 7 p 3 \) package. 4. Add a module named lambdafunc.py and define two functions with the names below. a. get_a_dictionary(). This function returns a dictionary constructed by reading the text file names.txt. b. greet_students(func, greeting, name). This function has a single line of statement to return a function received as an argument (i.e., return func(args), where the details of the args must be decided by you). This also means that a lambda function is going to be passed as an argument to replace the parameter func. 5. Add a tester snippet (the form is shown in the problem 1) to call the functions.


We have an Answer from Expert

View Expert Answer

Expert Answer


As mentioned in the question, first
We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe