Dear forum,
When I try to run the following code, I get this error message:
‘expected an indented block after “if” statement on line 9’. The ‘e’ in ‘else:’ is highlighted
#Initialize variables
count = int(input("Enter the count "))
total = int(input("Enter the total "))
if count > 0 and total // count > 0:
# the code to compute and print the result goes here
else:
print("Error: both conditions must be met.")
You need an actual Python statement. Include a pass keyword as a space filler for now or add an actual statement (i.e., print(‘Print statement for now until I figure out what I want to include here’)).
Thanks for the input. I had included the closing quotation marks in the original code but overlooked it in the post. Went back and edited the post again and included it.
If your code still doesn’t work, insert a pass statement under the comment with the same indentation level. That should function as a placeholder for the code I assume you haven’t written yet