bunki.py
#!/usr/bin/python
# -*- coding:utf-8 -*-
#Appropriate list for the time being
list = ['dog', 'cat', 'bird']
#Element to be a branch condition
a = 'dog'
"""
a in list is true(The element of a is included in the list)If it is, if is executed, if false, else is executed.
It can also be written as a not in list, and it is true if a is not included in the list.
"""
if a in list:
print 'if_do'
else:
print 'else_do'
Recommended Posts