Https://app.dataquest.io/m/313/conditional-statements/9/the-else-clause

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

Replace this line with the output/error

nothing to report

1 Like

Hello,

Kindly share the code you submitted for 9/12.

hey @jowatanga

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!

(thanks for writing it so, it gave me a small :smile:)

2 Likes

Continuing the discussion from Https://app.dataquest.io/m/313/conditional-statements/9/the-else-clause:
Thanks Unable to obtain a Nice Job on 9/12, but I was able to complete 12/12. Now Mission : Conditional Statement is indicating no completion,
Here is my code

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])
# 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’)

apps_data[0].append(‘free_or_not’)
print(apps_data[:6])

Hello @jowatanga

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.

Mission 9- If else clause
Here is my code:

INITIAL CODE

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:
    app.append('free')
else:
    app.append('not-free')

apps_data[0].append(‘free_or_not’)
print(apps_data[:6])

Thank you for your support!

1 Like

hey @jowatanga

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! :stuck_out_tongue: )

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])
2 Likes

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 :slight_smile:

1 Like

hey @prasadkalyan05

thanks for the reply. I corrected the not to non in my post :slight_smile:

1 Like

Wow… I had the same issue. I wonder why, even though there is a note saying to make sure to type “non-free” I typed “non_free”. Anyway. Thank you!