Day 1 of #100DaysOfCode: Recipe Name Generator

Today, I have created a mini project called the Recipe Name Generator, it includes the following python concepts I have learned today from Dr Angela Yu's 100DaysOfCode: The Complete Python Bootcamp:

  • Print() function

  • String Manipulation

  • Input functions

  • Variables

Recipe Name Generator program enables to create unique names for recipes which can be very useful when creating meals without predefined names. This program works by prompting the user to enter their responses to the following questions:

  • What is my name?

  • What is my favourite country?

  • What is my favourite food?

Once the user answered the questions, it generates a unique name of the recipe by combining all those answers together into one.

Python Concepts Used

Input Function

Input function requests the user to enter a response to the questions provided which are important in order to generate the recipe name. Each response replaces the input function of each question.

input("What is your name?")

input ("What is your favourite country?")

input("What is your favourite food?")

Variables

New variables store output of the program which can be referred back in the future such as printing the generated recipe name. Each input in the program is assigned to a variable which allows easy access to the responses itself.

Name = input("What is your name?")

Country = input ("What is your favourite country?")

Food = input("What is your favourite food?")

Print Function

Print function is asking the computer to print out the text that's inside the parenthesis and double quotation marks. It is used to print the responses which are stored in variables, giving the user with the generated recipe name.

String Manipulation

String manipulation is used in multiple ways to help increase readability and the ability to combine words together. In this project I have used string manipulation in two cases. Firstly, I created a newline character /n after the input function to make the program more readable for the user to enter the information.

Name = input("What is your name? \n")
print("\n")

Secondly, I used concatenation to combine the variables and strings into one to generate the recipe name for the user.

 print(Name + " " + Country + " " + Food)

In conclusion, the first day of learning the python concepts and creating a mini project that includes these concepts is enjoyable. For the full code of this mini project, please visit my GitHub Repository:https://github.com/keiransystem14/Python100daysofcode/tree/main/Day%201%20Project%20-%20Recipe%20Name%20Generator.