Hello there and welcome to this new section called: 'Learning Python with me'. Today, I will bring you one of the most basic commands, and we will create a name generator using Python. I am very excited to start this project and have you coming along with me! Scenario: We have a friend who has a beer company. He has everything: the product, the manufacturing, and the investment. But he is missing one single thing—the name of the company. He is struggling to think about it and asked us for help to create a name for him. We will use Python to generate two questions and combine them to create his beer company name! What will we use in Python: As you can see in the video, I am starting by leaving notes in Python. However, these notes cannot be left by themselves; they need to be preceded by a "#" symbol, which makes Python understand we are leaving comments instead of writing code. Variables: Variables are containers used to store data values. You create one by giving it a name and assigning a value using the "=" operator. Strings: Strings are sequences of text. In Python, they must be wrapped in either single quotes (' ') or double quotes (" "). Input: input() is a way to get information from the user. It allows the program to 'pause' and wait for you to type something into the console. So, as you can see, we are combining strings and inputs in the video. Why am I mentioning variables if I did not use them in the code? Because variables and strings tend to go together, so I could have used a variable to store and print the strings, something like this: result = ("The beer company name is: " + input("What is your favorite color?: ") + input("What is your favorite animal?: ")) print(result) This works exactly like the example in the video (you can test it). It's just that I put the print statement directly on the same line. As programmers, we want to save as much work as possible, so we keep everything clean and easy to read. I hope you enjoy it!" #Python #PythonProject #personalproject #DataScience #SideProject.

To view or add a comment, sign in

Explore content categories