Hello,
Thanks for your precious help,
This code seems ok excepted I cannot reach the line by adding a '\n' expression. As soon as I add a ' behind the variable in the f.write(num_str \n)line, my editor tells me num_str is not a variable.
Thanks for your precious help,
This code seems ok excepted I cannot reach the line by adding a '\n' expression. As soon as I add a ' behind the variable in the f.write(num_str \n)line, my editor tells me num_str is not a variable.
def add_zero(nbr: str, m: int = 6) -> str: return "0" * (m - len(nbr)) + nbr with open("dico.txt","w") as f: a = 0 while a <= 999999: if a <= 99999: num_str = add_zero(str(a)) else: num_str = str(a) f.write(num_str) a += 1