tactical-coder's blog

By tactical-coder, history, 6 weeks ago, In English

Hi all, I am new to programming. I am getting a runtime error on Test 1 and I have no clue how to fix it. It would be great if someone pointed out the mistake. This is the problem in python. Note: I tried with some use cases and it worked fine in pycharm. TIA

Code

  • limal = int(input(""))
  • bob = int(input(""))
  • years = 0
  • while limal <= bob:

      • limal = 3 * limal
      • bob = 2 * bob
      • years = years + 1 print(int(years))
 
 
 
 
  • Vote: I like it
  • 0
  • Vote: I do not like it

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it
Spoiler
»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

limal,bob = map(int,input("").split())

since the input format for the question is horizontal.

use map() and split() to take the input.

rest code is fine.

years = 0 while limal <= bob: limal = 3 * limal bob = 2 * bob years = years + 1 print(years)