+ 11

[CHALLENGE] decimal part

hello sololearners the idea is so sample create a program which takes a float as input then it calculates the decimal part ex: input : 3.14 output : 14 input : 4 output : 0 good luck😋😋😋

12th May 2018, 11:18 PM
Coder++
Coder++ - avatar
11 Réponses
14th May 2018, 6:10 PM
MeanMachine
MeanMachine - avatar
+ 12
# Python print(input().split('.')[1])
13th May 2018, 4:39 AM
Kartikey Sahu
Kartikey Sahu - avatar
12th May 2018, 11:50 PM
Warith Vatanaplachaigoon
Warith Vatanaplachaigoon - avatar
+ 8
Coder++ Enter a floating point number and see both the integer part and the fractional part displayed. https://code.sololearn.com/W8DZH4tNqd9D/?ref=app
14th May 2018, 2:00 AM
Paul K Sadler
Paul K Sadler - avatar
+ 4
https://code.sololearn.com/WEbR6cDC829f/?ref=app
13th May 2018, 10:39 AM
...
+ 3
https://code.sololearn.com/coMYG9Tmjq77/ I decided to look at others' projects after I finished mine. I must say, not bad at all. I hope you enjoy comments because mine has a lot.
13th May 2018, 8:24 PM
Denneisk
Denneisk - avatar
16th May 2018, 11:45 AM
Lamkerian Sorbol
Lamkerian Sorbol - avatar
+ 2
Python: my_float = float(input('Give me a float: ')) print(int((my_float - int(my_float))*100)) https://code.sololearn.com/c4Ws0czX6WtA/#py
15th May 2018, 11:38 AM
Dick Stada
Dick Stada - avatar
+ 1
سلام خوبی
13th May 2018, 6:14 PM
Najamodin Alimi
0
without converting to string and a ‘true’ ;) python one-liner: #assuming that input will always be a two-decimal point number print((lambda x: int((x%int(x))*101))(float(input())))
27th May 2018, 8:37 PM
Flash