@CodeABC123 Sorry, concatenation is a standard function in all programming languages, but I'm a little too used to the Java/C# way of doing it, so Python is a bit different than what I'm used to :)
You need to surround integers with the str() function to turn it into a string before concatenation. See fixed code above.
Profile icon
[deleted]
TypeError: ‘module’ object is not callable @niorg2606
Pretty solid. You should learn about string concatenation, though. That'll come in handy for formatting it instead of just having it be vertical.
I know. But can you show me a quick summary of it right now? @niorg2606
@CodeABC123 Sure.
will output something like:
You can use this to combine strings or other things that can be converted to strings. For example,
will print out
And, you can concatenate more than just two things at once as well:
will give you
TypeError: unsupported operand type(s) for +: int and str @niorg2606
@CodeABC123 Sorry, concatenation is a standard function in all programming languages, but I'm a little too used to the Java/C# way of doing it, so Python is a bit different than what I'm used to :)
You need to surround integers with the
str()
function to turn it into a string before concatenation. See fixed code above.TypeError: ‘module’ object is not callable @niorg2606
@CodeABC123 str is already built-in to the python language, so you don't need to import them I don't think
But it shows error. @niorg2606
@CodeABC123 Can you show me exactly what code you put in? It seems to work fine on the repl above.
Okay, I changed the Repl code to the error code. @niorg2606
@CodeABC123 Remove both
import int
andimport str
as both are already built into the language.