The file permission is set to 755, which means that the owner can read, write and search; others and group can only search in the file.import os file = "code.txt" os.chmod(file, 0o755) stat = os.stat(file) mode = oct(stat.st_mode)[-4:] print('The mode is:',mode) ...