codemaniacstudio

Write a Python program to perform input/output of all basic data types.

Write a Python program to perform input/output of all basic data types.

PROGRAM

# Input and Output for Basic Data Types in Python
# Integer
int_input = int(input(“Enter an integer: “))
print(“You entered integer:”, int_input)
# Float
float_input = float(input(“Enter a float number: “))
print(“You entered float:”, float_input)
# String
string_input = input(“Enter a string: “)
print(“You entered string:”, string_input)
# Boolean
bool_input_str = input(“Enter a boolean value (True/False): “)
print(“You entered boolean:”, bool_input)

OUTPUT

TRY THE ABOVE CODE

Exit mobile version