From 2cee64958ff1b97e9ad734c7f951babc1c6eb55d Mon Sep 17 00:00:00 2001 From: AlfianR7 Date: Thu, 23 Feb 2017 23:05:33 +0700 Subject: [PATCH] Alfian Rahman Aziz --- .idea/internship-basic-gen3.iml | 11 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + .idea/workspace.xml | 367 ++++++++++++++++++++++++++++++++ bigrandom/answer.py | 20 +- 6 files changed, 414 insertions(+), 2 deletions(-) create mode 100644 .idea/internship-basic-gen3.iml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 .idea/workspace.xml diff --git a/.idea/internship-basic-gen3.iml b/.idea/internship-basic-gen3.iml new file mode 100644 index 0000000..6711606 --- /dev/null +++ b/.idea/internship-basic-gen3.iml @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..5c9a502 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..645787b --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..25f51de --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,367 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + b + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1487684558710 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/bigrandom/answer.py b/bigrandom/answer.py index cb5fee4..d3c2648 100644 --- a/bigrandom/answer.py +++ b/bigrandom/answer.py @@ -1,6 +1,6 @@ class BigRandom: def __init__(self): - self.data = "data.txt" + self.data = open("data.txt","r") # add attributes if you need more def answer(self): @@ -11,6 +11,22 @@ def answer(self): # your algorithm - return (noh,suc) + for x in b.data: + for i in x: + x = x[1:] + if (i == "#"): + break + for i in x: + if ( i == "#"): + noh += 1 + suc += ord(i) + return (noh, suc) + +b = BigRandom() + +print (b.answer()) + + + # add methods if you need more \ No newline at end of file