A little bit of help!


#1

Hi, can someone please help me to make this program in python work, I can’t solve it.

A natural number is given. Enter the * sign between 2 digits, so that their multiplying will give the maximum multiplying.

Thanks,

P.s: Sorry for my bad english.


#2

Think about how you’d do it manually.

You’d need to separate the digits. Then try to multiply each consecutive pair of digits and remember the best one.

And, if you’re having trouble, think about what particular information you are missing. Once you’ve isolated that, you’re in a good position to ask about that, or better yet to google for it, because someone else has probably already asked.


#3

Can you give me a code for that?


#4

We can help you if you get stuck in a specific step, we can give general advice about how to break it down into small manageable steps (which ionatan did), but its your program, so in the end, you have to write the code


#5

I have no ideea how to separated digits for an int number, well thanks a lot anyway, I’ll try with str or something.:hugs:


#6

string is possible, its also possible to use modulo (%) and floor division (//), doing number % 10 gives the last digit, then doing number // 10 removes the last digit, then again you can gain the latest digit with modulo operator


#7

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