Assert failure - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Assert failure (/thread-34818.html) |
Assert failure - jtcostel - Sep-03-2021 We are supposed to write file out. This is what I have and I am still getting an assertion failure: with open('employee_salaries.tsv', 'w') as f_out: template = '{name},\t{salary}' for row in employee_table: sentence = template.format(name = row[0], salary = row[3]) print(sentence) f_out.write(sentence +'\n')Here is the assert test:
RE: Assert failure - buran - Sep-03-2021 We don't know what employee_table is and what data there are in it. Do you have the header in it? Also the expected output does not have comma (like your template) just tab. show what your generated file looks like.
|