Python 11.5 : Exercise : Error if this pizza already exists
Python is a high-level programming language that is widely used for developing various applications, including web development, scientific computing, data analysis, and artificial intelligence. One of the most popular features of Python is its simplicity and readability, making it an ideal language for beginners and experts alike.
In this exercise, we will be using Python to create a program that checks if a pizza already exists in a list of pizzas. The program will take input from the user and compare it with the existing list of pizzas. If the pizza already exists, the program will display an error message, and if it does not exist, it will add it to the list.
To achieve this, we will be using the basic concepts of Python programming, including variables, lists, conditional statements, and loops. We will start by defining a list of pizzas and then ask the user to input a new pizza. We will then run a loop to compare the input pizza with the existing list of pizzas. If the pizza already exists, we will display an error message, and if it does not exist, we will add it to the list.
Overall, this exercise is an excellent way to practice your Python programming skills and learn how to create useful programs that can be used in real-world scenarios.