type conversions and rounding there are situations where value may need to be converted from one data type into another you already know that combining an int with an int (usuallyproduces an intand combining float with float creates another float but what happens if we write an expression that mixes an int with floatfor examplewhat should the value of be after this assignment statementx if this is floating point multiplicationthen the result should be the float value if an int multiplication is performedthe result is before reading ahead for the answertake minute to consider how you think python should handle this situation in order to make sense of the expression python must either change to and perform an int operation or convert to and perform floating point operation in generalconverting float to an int is dangerous stepbecause some information (the fractional partwill be lost on the other handan int can be safely turned into float just by adding fractional part of soin mixed-typed expressionspython will automatically convert ints to floats and perform floating point operations to produce float result sometimes we may want to perform type conversion ourselves this is called an explicit type conversion python provides the built-in functions int and float for these occasions here are some interactive examples that illustrate their behavior int( int( float( float( float(int( ) int(float( ) int(float( ) as you can seeconverting to an int simply discards the fractional part of floatthe value is truncatednot rounded if you want rounded resultyou could add to the value before using int()assuming the value is positive more general way of rounding off numbers is to use the built-in round function which rounds number to the nearest whole value round(