-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from aashik1998/numofchar
number of characters in a file
- Loading branch information
Showing
3 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |