Closed lzblack closed 2 years ago
Hi professor! I changed the order of the code and reformatted the outcome, now the code works. Could you please show me how I can format the heading in line 8(attached below) to let it match with the content of the table?
print(f'a , mysqrt(a) , math.sqrt(a) , diff \n')
哦哦 那所以如果title全是字符的话是没有办法用“:一个数字”这种命令来定义长度的,只能数空格输入空格让他们对齐咯?
哦哦 那所以如果title全是字符的话是没有办法用“:一个数字”这种命令来定义长度的,只能数空格输入空格让他们对齐咯?
我猜你是问:如果不是 variable,可不可以用 {:}
in f-string. 其实也可以的,例子:
收到,谢谢老师!用tabulate这个library来控制打印的格式就好看很多!
Where is variable
y
coming from? https://github.com/michael4227/OIM3640/blob/4754539b1585eb00392381ba940fc590991045fe/session08/test_square_root.py#L13