How to do this??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 5

How to do this???

Define the function print_moves(moves) that takes in a list of moves. Print the available moves in the format "You may move __ or __ or __.". moves: a list of strings. For example, print_moves(["Left", "Right"]) should print the text You may move Left or Right..

14th Oct 2017, 4:10 AM
Damaen
Damaen - avatar
4 Answers
+ 10
Which language are you required to do this in?
14th Oct 2017, 4:23 AM
jay
jay - avatar
+ 4
def print_moves(lis): return "You may move "+" or ".join(lis) #Python solution assuming all your list elements are strings #if they're not all string, add this line: #lis=list(map(str,lis))
14th Oct 2017, 4:31 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
14th Oct 2017, 7:48 AM
Damaen
Damaen - avatar
0
I think this is what you wanted. https://code.sololearn.com/cWbQP75Yq8bq/?ref=app
22nd Oct 2017, 5:00 AM
Wack OO
Wack OO - avatar