Basic

Write a Python program to print an integer

Write a Python program to print an integer

In this tutorial, we will discuss a simple concept of Write a Python program to print an integer

Python program to print an integer

In this post, we are going to learn about how to print a integer number entered by user in C programming language

Program 1

#Python program to print an integer
#Entered by user
num=int(input("Enter the integer: "))
#input() function used to read a single line or text as a String
print("You entered",num)
#print() function used to display output in Python

When the above code is executed, it produces the following results

Enter the integer: 67
You entered : 67

In this program, the user can enter input and it is stored in num variable using input() function and displays entered value on the screen using the print() function in Python language.

 

In this program, input() function provides a piece of information to the user to entering an integer value and stored in variable num

num=int(input("Enter the integer: "))

Finally, the value stored in the variable num is displayed on the screen  by using print() function in Python

print("You entered",num)

 

Recommended post

Write a C program to print an integer

Write a Cpp program to print an integer

Write a Java program to print an integer

 

Suggested for you

Introduction of Python

Operator in Python

 

Write a Cpp program to print an integer
Python Programming language Data types
Karmehavannan

I am Mr S.Karmehavannan. Founder and CEO of this website. This website specially designed for the programming learners and very especially programming beginners, this website will gradually lead the learners to develop their programming skill.

Recent Posts

PHP Star Triangle pattern program

PHP Star Triangle pattern program In this tutorial, we will discuss about PHP Star Triangle…

2 months ago

PHP Full Pyramid pattern program

PHP Full Pyramid pattern program In this tutorial, we will discuss about PHP Full Pyramid…

2 months ago

5 methods to add two numbers in Java

5 methods to add two numbers in Java In this tutorial, we will discuss the…

2 months ago

Python Full Pyramid star pattern program

Python full Pyramid star pattern program In this tutorial, we will discuss  the concept of…

5 months ago

Write a function or method to convert C into F -Entered by user

Write a function or method to convert C into F -Entered by the user In…

10 months ago

How to write a function or method to convert Celsius into Fahrenheit

How to write a function or method to convert Celsius into Fahrenheit In this tutorial,…

10 months ago