I want the marble dots to be displayed in the output, and as the number of marbles go down, so do the asterisks. I don't know what command will have the asterisks descend as the while loop runs.
#!/usr/bin/env python3
marbles = 10 #You start out with 10 marbles
marble_dots = "**********" #Pretend these are ten marbles
while (marbles > 0):
print(marble_dots[:10])
#This prints out how many marbles you have left.
# We have to say str(marbles) because marbles is a number
# and we want to use it in a string (letters and other characters)
print("You have " + str(marbles) + " marbles left.")
if (marbles < 4):
print("Warning: You are running low on marbles!!")
#This is another way of saying "Subtract 1 from the marbles variable"
# It is logically the same as writing "marbles = marbles - 1", just shorter
marbles -= 1
# Make a newline, so there's an empty line before the next time we run this loop
print("")