Explore

Close
Python Programs Share

How To Print Int Value In Python

How To Print Int Value In Python

You are a beginner to python programming and you have created an int or integer value in your python program. Now you want to print the integer in the console.

Then you are at the right place in this tutorial. I will show you how to print integer values in python.

This is going to be short and a simple python tutorial on printing an int value in python and python is very handy at syntax which makes it easy to learn and understand. Now let’s see how to print int in python.

Printing a Int Value in Python


num = 1;
print(num);

#Output
1

Above is the code to print int in python as you can see we have given the variable name number and assigned it to a number which is an integer then we have used print() function to print the num variable value.

You can test the above code in an online python compiler, you can use the Onlinegdb Compiler.

That was it as I have said python is very easy. You don’t have to declare what type of datatype the variable is and the same thing you have to do to print a string value, no need to do anything in the print().

Printing a String Value in Python


text = 'hello';
print(text);

#Output
hello

That was a short and simple tutorial. I hope you found it useful and helpful. If you want more python tutorials, than join our Telegram Channel for latest blog updates.

Here are some more python guides and tutorials you may find helpful:

Thank you for reading, have a nice day 🙂