#!/bin/python3 print('Make test file') test = open('test.txt', 'w') test.close() print('Test with no keyword') test = open('test.txt', 'r+') try: test.truncate(0) print('Pass') except: print('Fail') test.close() print('Test with keyword') test = open('test.txt', 'r+') try: test.truncate(size=0) print('Pass') except: print('Fail') test.close()