Change the following code into a function that prints a crazy
headline. It should take the values as parameters. Be sure to call
the function to test it.
code:
input = "Elvis, alien, blue"
pieces = input.split(",")
name = pieces[0]
thing = pieces[1]
color = pieces[2]
headline = name + " was abducted by a " + color + " " + thing +
"."
print(headline)
Save & Run Load History 1 input = "Elvis, alien, blue" 2 pieces = input.split(",") 3 name = pieces[0] 4 thing pieces[1] 5 color = pieces[2] 6 headline = name + " was abducted by a " + color + 7 print (headline) 8 11 + 00
Change the following code into a function that prints a crazy headline. It should take the values as parameters. Be sure
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Change the following code into a function that prints a crazy headline. It should take the values as parameters. Be sure
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!