Python Syntax
Here, you will learn the basic syntax of Python 3.
Display Output
The print() funtion in Python displays an output to a console or to the text stream file. You can pass any type of data to the print() function to be displayed on the console.
Example: Display Output
name="Ram"
print(name) # display single variable
age=21
print(name, age)# display multiple variables
print("Name:", name, ", Age:",age) # display formatted outputBy default, a single space ' ' acts as a separator between values. However, any other character can be used by providing a sep parameter. Visit the print() funtion for more information.
Getting User's Input
The input() function is used to get the user's input. It reads the key strokes as a string object which can be referred to by a variable having a suitable name.