NicoSal
December 10, 2020, 11:06pm
#1
Tell us what’s happening:
i just started with python, i’m stuck in this problem.
i tried everything i know … please, give me some hints
Your code so far
https://repl.it/@NicolSalvato/boilerplate-arithmetic-formatter#arithmetic_arranger.py
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
.
Challenge: Arithmetic Formatter
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
sanity
December 11, 2020, 7:43am
#2
At what part exactly are you stuck? What did you try already?
ilenia
December 11, 2020, 8:46am
#3
in one case you are returning the arranged numbers instead of the too many mumbers error - maybe check your condition
NicoSal
December 11, 2020, 3:13pm
#4
because in pycharm i have zero error but repl.it return 6 failed… i dont know where i’m failing
ilenia
December 11, 2020, 4:53pm
#5
in one case you are returning the arranged numbers instead of “Too many problems”
what’s the max number of problems?
NicoSal
December 11, 2020, 6:23pm
#6
max number of problems are 5
ilenia
December 11, 2020, 6:26pm
#7
now everything passes, have you changed anything?
NicoSal
December 11, 2020, 7:04pm
#8
nope
that’s why i dont know where to change the code to pass the exam
(same in pycharm… it gave me 0 error)
ilenia
December 11, 2020, 8:58pm
#9
if you pass all tests than it’s done
You will want to check every operator for and error by adding the operator check to the for loop. Also your code always returns “Error: Operator…”. For that you might want to try:
if not (operator == "+" or operator == "-"):
NicoSal
December 11, 2020, 11:15pm
#11
thank you
I have added a function for handling errors and now it works