User:Bohye Woo/Prototyping 02

From XPUB & Lens-Based wiki
< User:Bohye Woo
Revision as of 17:17, 21 January 2019 by Bohye Woo (talk | contribs) (Created page with "* import time <source lang=python> import time l = ["1111111", "2", "3122", "4", "5"] # [0]. [1], [2], [3], [4] i = 0 while True: for person in l: if len(person) > 4: #...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
  • import time
import time

l = ["1111111", "2", "3122", "4", "5"] # [0]. [1], [2], [3], [4]
i = 0

while True:

	for person in l:
		if len(person) > 4: # if the length of [0] item is bigger than 4 
			print(person, "bigger than") 

		elif len(person) == 4:
			print("4")

		else:
			print(person, "smaller than")

		time.sleep(0.1)
		
	print('looping', i)
	i = i + 1
	time.sleep(1)