Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- I have a string (game_string) that jumbles its dollar signs (in the format ".$.$.$.$." with a total of exactly 9 characters). Since it jumbles I can have "$.$.$.$.." or ".$.$.$$.." or ".$$.$.$.." ... you get the idea. I have a function:
- """
- def move_dollar_to_the_left(game_string, position_number, to_move):
- return game_string
- """
- This function is supposed to move a dollar sign to the left by the amount the to_move is set. So for instance:
- 123456789
- ..$.$..$$
- I want to move the 8th dollar sign to the left by 1 so the result will be:
- 123456789
- ..$.$.$.$
- How do I make sure that the game_string is returned in the change format? i.e. the dollar sign has been moved to where the user wants to and it returns the final outcome
- """
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement