尝试从数组中选择vdiv和hdiv?
divOptions = [['|', '-'], ['4', '2'], ['v', 'h']]
divChoice = input('1 = |, - \n2 = 4, 2 \n3 = v, h \nPlease choose a number: ')
divInt = divOptions[divChoice - 1]
vdiv, hdiv = divInt
答案 0 :(得分:0)
你想要的是
vdiv, hdiv = divInt[0], divInt[1]
并将输入转换为整数:
divChoice = int(input(...))