dimanche 29 janvier 2017

Python math code greater than and less than not working

import numpy as np
import random
i = random.randint(1,100)
if i > 0 and i <16:
    print ("Broken")
else if i > 16 and i > 100
    print ("Not broken")

I am trying to make it if the number is between 1 to 15 the racquet is broken but if it is 16-100 it is not broken. It says it is invalid syntax in python. Why is it invalid syntax?

Aucun commentaire:

Enregistrer un commentaire