Skip to content

Commit daaf7af

Browse files
committed
Ratio of positive negative integer
Railway time Calculator
1 parent 6a96b52 commit daaf7af

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

basic.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,3 +186,41 @@
186186
# print("*",end="")
187187
# print()
188188
# space=space-1
189+
190+
# Ratio of positive negative integer
191+
# def plusMinus(arr):
192+
# arr = [1, -2, 0, 3, -4]
193+
# positive_ratio, negative_ratio, zero_ratio = (
194+
# format(len([x for x in arr if x > 0]) / len(arr), ".6f"),
195+
# format(len([x for x in arr if x < 0]) / len(arr), ".6f"),
196+
# format(len([x for x in arr if x == 0]) / len(arr), ".6f"),)
197+
# print(positive_ratio)
198+
# print(negative_ratio)
199+
# print(zero_ratio)
200+
#
201+
#
202+
# if __name__ == '__main__':
203+
# n = int(input().strip())
204+
#
205+
# arr = list(map(int, input().rstrip().split()))
206+
#
207+
# plusMinus(arr)
208+
209+
210+
# Convert 12 hrs time to 24 hrs railway time
211+
# def timeConversion(s):
212+
# if s[-2:] == "AM" and s[:2] == "12":
213+
# return "00" + s[2:-2]
214+
# elif s[-2:] == "AM":
215+
# return s[:-2]
216+
# elif s[-2:] == "PM" and s[:2] == "12":
217+
# return s[:-2]
218+
# else:
219+
# ans = int(s[:2]) + 12
220+
# return str(str(ans)+s[2:8])
221+
# if __name__ == '__main__':
222+
# s = input()
223+
# result = timeConversion(s)
224+
# print(result)
225+
226+

0 commit comments

Comments
 (0)