+ 1
int and string
how to print a string with an int of an assigned value num=1.2 int(print(" the whole number is: ",num)) expected output the whole number is: 1
4 Respostas
+ 4
Namratha Nair you just need to store the int typecast value in an variable and then print that
num=1.2
n=int(num)
print(n)
+ 2
In line number two you have written int(print(".....")) instead of print u need to write input if i am not wrong or if you are trying to print value in integer then simply u need to do casting like this
print(int(num))
0
print( f"the whole number is : {num}")
0
#Try this
num=1.2
print(" the whole number is: ", int(num))