Skip to content

Commit

Permalink
Merge pull request #44 from aashik1998/numofchar
Browse files Browse the repository at this point in the history
number of characters in a file
  • Loading branch information
adithyaanilkumar authored Oct 3, 2020
2 parents dde5f20 + 3a3fc02 commit d108405
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Python/num_of_char/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Input
The input to the program(to find the number of characters) is the text file input.txt containing the following text
>Hacktoberfest is an annual global hackathon event celebrating open source software hosted by DigitalOcean in partnership with GitHub. The event was created to raise awareness for the open source community and encourage participation in open source projects. Participants are challenged to contribute a specific amount of pull requests during the month of October to public open source repositories on GitHub in order to earn a limited-edition T-shirt and swag from the host and sponsors. In 2018, the number of pull requests necessary to receive a T-shirt was raised from 4 >to 5 and Twilio joined as a sponsor.
# Output
After running the program,it will print the number of characters in the input file that is "input.txt" as follows
```sh
$ python code.py
The number of charcter in the input.txt file is
611
```
8 changes: 8 additions & 0 deletions Python/num_of_char/code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
filevar=open("input.txt","r")
char=filevar.read()
num_character=0
for i in char:
num_character=num_character+1
print("The number of charcter in the input.txt file is")
print(num_character)
filevar.close()
1 change: 1 addition & 0 deletions Python/num_of_char/input.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Hacktoberfest is an annual global hackathon event celebrating open source software hosted by DigitalOcean in partnership with GitHub. The event was created to raise awareness for the open source community and encourage participation in open source projects. Participants are challenged to contribute a specific amount of pull requests during the month of October to public open source repositories on GitHub in order to earn a limited-edition T-shirt and swag from the host and sponsors. In 2018, the number of pull requests necessary to receive a T-shirt was raised from 4 to 5 and Twilio joined as a sponsor.

0 comments on commit d108405

Please sign in to comment.