We will learn about the following concepts of python.
- print()
- input()
- String Concatenation
- String Manipulation
- Variables
print()
This function is used to print any data (string, integer, a boolean value, etc) in the python console.
Make sure to use single or double quotes in the print function, if you are going to print a string. Don't need quotes if you are going to print any other data type.
print("Hello World!")
input()
This function is used to get input from the user.
input("What is your name?")
The output will be print next to the input.
Variables
We can store data values in variables, to use them later. Following are some rules to write variables in python and you should keep them in mind.
- A variable name must start with a letter or the underscore character
- A variable name can only contain alpha-numeric characters and underscores (A-z, 0-9, and _ )
- Variable names are case-sensitive (age, Age, and AGE are three different variables)
- A variable name cannot start with a number
var name = "John Doe"
print(name)
name value (John Doe) will print in the next line.
You can test your code here. https://www.programiz.com/python-programming/online-compiler/
Project
You can check the Brand name generator project, you can check here.
https://dev.to/shaheryaryousaf/brand-name-generator-in-python-3744
Top comments (0)