※ 引述《tiger66 (虎虎)》之铭言:
: 请问各位大神,我最近是用2x版本的书在学习,
: 用的是3.x的版本。
: 这个问题我试了非常多次搞不懂,才上来问。
: 我想要出现的结果是
: *****
: *****
: *****
: 但是一直呈现下面这样,而且还出现built-in function print,
: 请问要怎么去掉呢?谢谢。
: numlines = int(input('how many lines do you want?'))3
: numstars = int(input('how many stars do you want?'))5
: for line in range (0, numlines):
: for star in range(0, numstars):
: print('*',)
: print
for line in range(numlines):
print(“*” * numstars)
The reason for the last <built-in function print>
Was because you called “print” without (),
which is a function itself.
Then you need to remember that print function
automatically appends a newline for you.
Good luck~~
: *
: *
: *
: *
: *
: <built-in function print>
: *
: *
: *
: *
: *
: *
: <built-in function print>
: *
: *
: *
: *
: *
: <built-in function print>