Your problem is in the use of input(), in particular when used in Python 2.
In Python 2, a call to input() prompts the user for input, and then uses eval() to try to evaluate it as an expression. So, whatever you input needs to be something that’s valid code, and most words are not. In Python 2, if you want to just grab input from the user, you need to use raw_input():
tmartin:dart:~> python
Python 2.7.18 (default, Apr 20 2020, 19:19:54)
[GCC 9.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> material = input("enter the material: ")
enter the material: quartz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in <module>
NameError: name 'quartz' is not defined
>>> material = raw_input("enter the material: ")
enter the material: quartz
>>> material
'quartz'
>>>
In Python 3 this was changed, so now input() does what raw_input() used to do in Python 2:
tmartin:dart:~> python3
Python 3.8.3 (default, May 15 2020, 02:05:39)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> material = input("enter the material: ")
enter the material: quartz
>>> material
'quartz'
So the short answer to your question is, use raw_input() and not input() in your code here. If you’re following a tutorial of some sort and hitting this error, it’s because you’re trying to run the program in Python 2 instead of Python 3 as the tutorial probably expects.