Scientific Computing with Python Projects - Arithmetic Formatter

Tell us what’s happening:

I am trying to use print without the newline ending, however instead of printing all the items on one line, it seems to print an object:

>>>    32 [object Object]
>>>   3801 [object Object]
>>>   45 [object Object]
>>>   123 [object Object]

When I run this in my own IDE it works as expected.

Your code so far

for problem in problems:
        print(problem[1] , end = "    ")

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36

Challenge Information:

Scientific Computing with Python Projects - Arithmetic Formatter

You appear to have created this post without editing the template. Please edit your post to Tell us what’s happening in your own words.

This platform does not appear to support the “end” argument of print()

In any case, your function will never really use print like this. You will need to build a full string and then return it at the end. The output would be printed once at the end, not using multiple calls to print.

If you call it like this

print(arithmetic_arranger(problems,True))

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.