Jun-01-2020, 08:54 AM
I want to solve a meal cost challenge as part of learning python but when I put the following code which the website gave me, I had two problems:
Second problem: What does the if block mean. i.e
Thanks for your help.
import math import os import random import re import sys # Complete the solve function below. def solve(meal_cost, tip_percent, tax_percent): if __name__ == '__main__': meal_cost = float(input()) tip_percent = int(input()) tax_percent = int(input()) solve(meal_cost, tip_percent, tax_percent)The first problem is: 1. My editor gave an Indentation error on the if block. It says it expected an indented block. What does that mean and how do I resolve it?
Second problem: What does the if block mean. i.e
if __name__ == '__main__':.... What does it actually mean? In my readings I have not come across such an expression. Just a noob still therefore why I am taking the challenge to improve.
Thanks for your help.