I can't put an integer on the string, so what should I do?
TypeError: unsupported operand type(s) for +: 'int' and 'str'
for i in range (1,10):
string="string"+i
Cannot perform +
operation because the two are of different types. Therefore, instead of an integer i
, str(i)
should be a string.
Last result, string is
for i in range (1,10):
string="string"+str(i)
string = []
for i in range(1,10):
string.append("string"+str(i))
#or
string = ["string"+str(i) for i in range(1,10)]
572 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
581 PHP ssh2_scp_send fails to send files as intended
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.