This is the code:

```#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the solve function below.
def solve(meal_cost, tip_percent, tax_percent):
tip = meal_cost * (tip_percent / 100)
tax = meal_cost * (tax_percent / 100)
total_cost = meal_cost + tip +tax
print(round(total_cost, 2))

if name == '__main__':
meal_cost = float(input())

tip_percent = int(input())

tax_percent = int(input())
#ron = round(total_cost)
#print(ron)

solve(meal_cost, tip_percent, tax_percent)``` Oct 12 in Python 29 views

## 1 answer to this question.

Remove main & try or

`Use __name__ instead of name`

I hope it will work. answered Oct 12 by
• 50,260 points

## Python argparse error "NameError: name 'file' is not defined"

The right datatype for destination in argpasrse module ...READ MORE

## Python error "NameError: name 'sr' is not defined"

NameError: name 'xx' is not defined Python knows ...READ MORE

## Python error "Python NameError: global name 'Thread' is not defined"

There is a built-in function with the ...READ MORE

–1 vote

## Python error saying "NameError: name 'email' is not defined"

you need to define the variable email READ MORE

## how can i randomly select items from a list?

You can also use the random library's ...READ MORE

+1 vote

## how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

## how do i use the enumerate function inside a list?

can you give an example using a ...READ MORE

## Lowercase in Python

You can simply the built-in function in ...READ MORE