fork(1) download
  1. #!/usr/bin/env python3
  2.  
  3. data_t = [[20, 40, 60], [88, 44, 22]]
  4.  
  5. if __name__ == '__main__':
  6. [print('{} {} {}'.format(*i)) for i in data_t]
  7. x = int(input('探索値は?'))
  8. print('{1}は2行目の左から{0}番目に存在'
  9. .format(*[i for i in enumerate(data_t[1], 1) if i[1] == x][0])
  10. if x in data_t[1] else "")
  11.  
  12.  
Runtime error #stdin #stdout #stderr 0.15s 26148KB
stdin
Standard input is empty
stdout
20 40 60
88 44 22
探索値は?
stderr
Traceback (most recent call last):
  File "./prog.py", line 7, in <module>
EOFError: EOF when reading a line