fork download
  1. file = open("yomikomi.txt","r") #テキストを読み込む
  2. for number in file:
  3. if number != number.isdigit(): #数字以外の場合文字を出力
  4. print("文字列です")
  5. elif number % 3 == 0 and number % 5 == 0:
  6. print("3と5の倍数です")
  7. elif number % 3 == 0:
  8. print("3の倍数です")
  9. elif number % 5 == 0:
  10. print("5の倍数です")
  11. else:
  12. print("数字です")
Runtime error #stdin #stdout #stderr 0.01s 28384KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Traceback (most recent call last):
  File "./prog.py", line 1, in <module>
FileNotFoundError: [Errno 2] No such file or directory: 'yomikomi.txt'