Horje
how to repeat if statement in python Code Example
how to repeat if statement in python
def main():
    while True:
        again = raw_input("Would you like to play again? Enter y/n: ")

        if again == "n":
            print ("Thanks for Playing!")
            return
        elif again == "y":
            print ("Lets play again..")
        else:
            print ("You should enter either \"y\" or \"n\".")

if __name__ == "__main__":
    main()




Python

Related
how to hide a turtle in turtle python Code Example how to hide a turtle in turtle python Code Example
list to dict python with same values Code Example list to dict python with same values Code Example
get file size python Code Example get file size python Code Example
python txt to parquet Code Example python txt to parquet Code Example
run python script from repl Code Example run python script from repl Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
7