The
Python
Output:
Python
Output:
oftype() is an inbuilt function in julia which is used to convert a given type of element y(say) into x(say) type of element.
Syntax: oftype(x, y) Parameters:Example 1:Returns: It returns the converted type of elements.
- x: Specified first type of element.
- y: Specified second type of element.
# Julia program to illustrate
# the use of oftype() method
# Getting the converted type of elements.
a = 1;
b = 2.0;
println(oftype(a, b))
2Example 2:
# Julia program to illustrate
# the use of oftype() method
# Getting the converted type of elements.
a = 1;
b = 2.0;
println(oftype(b, a))
1.0