Conditional statement: I have an issue with 9/12, I completed coding and moved to the next, and onto 12/12 to complete. 9/12 does not spit out NEXT after submitting an answer. mission is not checked as completed, I repeated coding on 9/12 yet no luck, please advise
I completed other missions including Conditional Statement.
John W
My Code: code is alright
Replace this line with your code
What I expected to happen: mission completed- conditional statement
What actually happened: Mission does not check as completed at 12/12
this might a temp bug while you were completing your course or instead of “submit” you might have only clicked on “run” and proceeded to next instruction using the manual next or there could be a problem with the code itself.
Can you try to submit the code as-is on this mission or as @doyinsolamiolaoye suggested to share the code, so that we can double-check if its really alright!
for app in apps_data[1:]:
price = float(app[4])
# Complete code from here
for app in apps_data[1:]:
price = float(app[4])
if price == 0.0:
app.append(‘free’)
else:
app.append(‘non_free’)
I just encountered the same problem which you’ve shown above. Though i completed answers to all other missions but 9/12 does not spit out NEXT after submitting an answer and indicating as no completion.
It seems to look like a technical issue.
DQ, team kindly advise so that we’ll proceed accordingly.
The code you have provided doesn’t help in understanding the indentation, so not sure if that was an issue.
Also, the instructions were to add “non-free” and your code has “non_free”. (this is common with all of us! )
Anyway, this should be the final code. this is accepted by console as well.
opened_file = open('AppleStore.csv')
from csv import reader
read_file = reader(opened_file)
apps_data = list(read_file)
for app in apps_data[1:]:
price = float(app[4])
if price == 0.0:
app.append('free')
else:
app.append('non-free')
apps_data[0].append('free_or_not')
print(apps_data[:6])
My bad : I typed (‘not-free’), instead of (‘non-free’) in else clause. I figured it out and completed the mission successfully. @Rucha: Your code helped me to figure out the issue. Thank you