Codeforcoding

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

Write a Java 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 Python program to print an integer

write a Java program print characters of a string

write a C++ code to print characters of a string

write a C Code to print characters of a string

write a Java program to print characters of a string

 

 

Suggested for you

Introduction of Python

Operator in Python

 

Write a Cpp program to print an integer
Python Programming language Data types
Exit mobile version