0

I have two sets which returns a specific value. I would like to carry out an operation on set apple. if length of this this set is greater than 0, i woulf like to calculate the elapsed time. If the time passed more than 10 sec, i would like to reset time to zero. Any suggestion to deal this?

apple = set([1,5,9,13])
orange = set([2,4,6,8,10])

def fruit(apple,orange): 
    if len(apple)>0:
        time_now = time.time()
    if time_now >10:
        apple.clear()
        time_now == 0
return apple, orange  
Venkat kamal
  • 279
  • 2
  • 3
  • 8

0 Answers0