Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me write this code using PYTHON!!! PROBLEM 3: Einz Function Name: pickup() Parameters: hand a list of strings discard a list of strings

Please help me write this code usingĀ PYTHON!!!

image

PROBLEM 3: Einz Function Name: pickup() Parameters: hand a list of strings discard a list of strings Return Value: None Description: You are playing the hit German card game with your friends, Einz. Each card in this game has a number 1-9 and a color: red, blue, green, or yellow (i.e. "red 1", "blue 8", etc). The rules of the game are pretty hard to explain, but all you need to know is that if the cards in your hand are in increasing order and the cards in the discard pile are also in increasing order, you have to pick up the discard pile and add it to your hand. Write a function that simulates this game rule and prints out your new hand. For the sake of simplicity, assume both your hand and the discard pile are already in increasing order. Test Cases: >>> pickup (["red 2","blue 4"], ["green 1","yellow 6", "red 9"]) Your new hand is red 2, blue 4, green 1, yellow 6, red 9. >>> pickup (["green 4","yellow 5"], ["red 4","blue 7"]) Your new hand is green 4, yellow 5, red 4, blue 7.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Elements Of Chemical Reaction Engineering

Authors: H. Fogler

6th Edition

013548622X, 978-0135486221

More Books

Students also viewed these Programming questions