May-03-2018, 06:47 AM
Good evening everyone, I have a doubt, I am trying a number of lists to select from each a random value, then I want to format a string depending on the choice of value, this string is a statement of a question eg:
"Juan has 10 dollars, if each apple is worth 2 dollars, how many apple can he buy?"
i have this:
"Juan has 10 dollars, if each apple is worth 2 dollars, how many apple can he buy?"
i have this:
name = ["Carlos","Daniel","Gabriel","Santiago","Aldo"] product = ["apple", "pie", "soda", "lemon"] dollars = [50, 75, 100, 125, 150] cost = [5, 6, 7, 8, 9,10] statement = "$ has $ dollars. if each $ is worth $ dollars. how many $ apple can he buy?" statement.replace("$", "%s")I know how to make the random choice of a list, but i want to give the appropiatre format to the statement var accord the choices, can you bring me a light?, thanks!