Hi, this is not my code. I am just wondering why the programmer wrote the first two lines instead of using input()? I understand that he is just assigning the function sys.stdin.readline to the variable input, then calling sys.stdin.readline using input() in line 3, but why go through all that trouble. Why not just use the function input()? I know that the function input() uses sys.stdin.readline() under the hood, but why not just use input()? Thanks.
import sys input = sys.stdin.readline curDay, days = map(int, input().split()) curDay -= 1 cur = 1 print('Sun Mon Tue Wed Thr Fri Sat') for i in range(curDay): print(' ', end='') while True: print('%3d' % (cur), end='') if cur == days: print() break cur += 1 curDay += 1 if curDay == 7: curDay = 0 print() else: print(" ", end='')