team=['sato','nao','john','lisa','kaoru','ryo','bob','jack','mary','linda','yosuke','takashi','saori', 'yuki','tomo', 'take','yusuke','nori','mari','sachi']
boss=['john','lisa','bob','jack','takashi','nori','mari','sachi']
even=[]
odd=[]
cnt = 1
for member in team:
if(cnt%2 == 0):
even.append(member)
else:
odd.append(member)
cnt = cnt + 1
print(even)
print(odd)
['nao', 'lisa', 'ryo', 'jack', 'linda', 'takashi', 'yuki', 'take', 'nori', 'sachi']
['sato', 'john', 'kaoru', 'bob', 'mary', 'yosuke', 'saori', 'tomo', 'yusuke', 'mari']
team=['sato','nao','john','lisa','kaoru','ryo','bob','jack','mary','linda','yosuke','takashi','saori', 'yuki','tomo', 'take','yusuke','nori','mari','sachi']
boss=['john','lisa','bob','jack','takashi','nori','mari','sachi']
even=[]
odd=[]
cnt = 1
for member in team:
if(cnt%2 == 0):
name = member + ' even'
even.append(name)
else:
name = member + ' odd'
odd.append(name)
cnt = cnt + 1
print(even)
print(odd)
['nao even', 'lisa even', 'ryo even', 'jack even', 'linda even', 'takashi even', 'yuki even', 'take even', 'nori even', 'sachi even']
['sato odd', 'john odd', 'kaoru odd', 'bob odd', 'mary odd', 'yosuke odd', 'saori odd', 'tomo odd', 'yusuke odd', 'mari odd']
def show_member(num):
even=[]
odd=[]
for n in range(len(boss)):
if(n%2==0):
even.append(boss[n])
else:
odd.append(boss[n])
if(num%2==0):
print_member(even)
else:
print_member(odd)
def print_member(mlist):
for member in mlist:
print(member)
#ぶんりする
def show_boss(n):
boss=['john','lisa','bob','jack','takashi','nori','mari','sachi']
print(n)
for n in range(n):
print(boss[n])
def say():
print('hello')
def sayst(word):
print('---------')
print(word)
print('---------')
sayst('start')
show_boss(5)
say()
sayst('end')
---------
start
---------
5
john
lisa
bob
jack
takashi
hello
---------
end
---------