Hackerrank Floor, Ceil and Rint Solution
1 min read

Hackerrank Floor, Ceil and Rint Solution

Hackerrank Floor, Ceil and Rint Solution

Solution in python3

Approach 1.

import numpy
a = numpy.array(input().split(),float)
print(numpy.floor(a),numpy.ceil(a),numpy.rint(a),sep="\n")

Approach 2.

from numpy import *
A = array([float(x) for x in input().split()],float)
print(floor(A),ceil(A),rint(A),sep = '\n')

Approach 3.

import numpy
a=numpy.array(input().split(" "), float)
print(numpy.floor(a))
print(numpy.ceil(a))
print(numpy.rint(a))

Solution in python

Approach 1.

import numpy as np
A =np.array(raw_input().split(),float)
print np.floor(A)
print np.ceil(A)
print np.rint(A)

Approach 2.

import numpy
a=numpy.array(map(float,raw_input().split()))
print numpy.floor(a)
print numpy.ceil(a)
print numpy.rint(a)

Approach 3.

import numpy
A = numpy.array(map(float, raw_input().split()))
print numpy.floor(A)
print numpy.ceil(A)
print numpy.rint(A)

Enjoying these posts? Subscribe for more


Adblocker detected! Please consider reading this notice.

We've detected that you are using AdBlock Plus or some other adblocking software which is preventing the page from fully loading.

That's okay. But without advertising-income, we can't keep making this site awesome.

We don't have any banner, Flash, animation, obnoxious sound, or popup ad. We do not implement these annoying types of ads!

We need money to operate the site, and almost all of it comes from our online advertising.

Please add thepoorcoder.com to your ad blocking whitelist or disable your adblocking software.

×