Computer Science, asked by ishatilwani11, 2 months ago

Take a float input from the user and type cast it to int and print it on
the screen.​

Answers

Answered by darkerdemure
2

Explanation:

#python_bruh_python

my_input = float('Enter Your Thing >>> ')

Answered by SaurabhJacob
1

The python program for the given problem is,

a=float(input("Enter a number = "))

b=int(a)

print("Type casted number is",b)

In the above program,

  • 'a' variable is taking input from the user which is of float data type.
  • The float data type is a decimal type number.
  • 'b' variable is storing the typecasted value of the 'a' variable.
  • In the end, the print statement is used to output the typecasted value.

Typecasting is a method of programming language that is used to convert a type of data type to another data type.

It is of two types Implicit and Explicit typecasting.

Similar questions