Start with Python

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.

Mak…


This content originally appeared on DEV Community and was authored by Shaheryar

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


This content originally appeared on DEV Community and was authored by Shaheryar


Print Share Comment Cite Upload Translate Updates
APA

Shaheryar | Sciencx (2021-04-09T23:56:35+00:00) Start with Python. Retrieved from https://www.scien.cx/2021/04/09/start-with-python/

MLA
" » Start with Python." Shaheryar | Sciencx - Friday April 9, 2021, https://www.scien.cx/2021/04/09/start-with-python/
HARVARD
Shaheryar | Sciencx Friday April 9, 2021 » Start with Python., viewed ,<https://www.scien.cx/2021/04/09/start-with-python/>
VANCOUVER
Shaheryar | Sciencx - » Start with Python. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/04/09/start-with-python/
CHICAGO
" » Start with Python." Shaheryar | Sciencx - Accessed . https://www.scien.cx/2021/04/09/start-with-python/
IEEE
" » Start with Python." Shaheryar | Sciencx [Online]. Available: https://www.scien.cx/2021/04/09/start-with-python/. [Accessed: ]
rf:citation
» Start with Python | Shaheryar | Sciencx | https://www.scien.cx/2021/04/09/start-with-python/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.