Python Online Compiler & Playground
HTML/CSS/JavaScript
HTML
CSS
Javascript
C++
C
PHP
Java
Python
Swift
C#
Ruby
Node.JS
Kotlin
jQuery
Go
R
TypeScript
Start Python Course
Register
RIPI (Round If Potential Integer) custom function
0
Author: Jonathan Dodge
Dark
Public
Save
PY
py
1
2
3
4
5
6
7
8
def
ripi
(
x
,
y=
0
):
while
y<x
:
y+=
1
if
((
x-y
)
==
0.0
):
return
(
y
)
else
:
return
(
x
)
print
(
ripi
(
float
(
input
())))
Enter to Rename, Shift+Enter to Preview
OUTPUT