Please accept, thank you!
# 输出方式一,将整数转为字符串输出
print(str(4+4)+'\n'+str(8)+'\n'+str(2*4)+'\n'+str(9-1))
# 输出方式二,使用f和花括号
print(f'\n')
print(f'{4+4}\n{8}\n{2*4}\n{9-1}')

0 Answer
Please accept, thank you!
# 输出方式一,将整数转为字符串输出
print(str(4+4)+'\n'+str(8)+'\n'+str(2*4)+'\n'+str(9-1))
# 输出方式二,使用f和花括号
print(f'\n')
print(f'{4+4}\n{8}\n{2*4}\n{9-1}')
This is a syntax error. The correct approach is to separate sections with commas and specify newlines as output intervals
print(4+4,8/1,2*4,9-1,sep='\n')
The little girl refers to bing and GPT for some content tuning :
Because Python is a programming language, its syntax is strict and cannot be written at will. In the above code, there is a syntax error in 4+4m8/1Wm2*4Wng9-1, so Python cannot parse correctly and return the result.
To print the four 8s correctly, it needs to be expressed in proper Python syntax, which can be done using the print function as follows:
print(8, 8, 8, 8)
The code above prints four eights, each separated by a space.
The answer is not easy, so take it.
这家伙很懒,什么都没留下...