Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit de13fa7

Browse files
heads tails counter
1 parent 4c5f2a3 commit de13fa7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎AvgWordsInFile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@
2626
"Number of Words: {}\n"
2727
"Avg Word Length: {}\n\n".format(line_num, line,
2828
len(line.split()),
29-
("{:.1f}".format(char_count / len(line.split())))))
29+
"{:.1f}".format(char_count / len(line.split()))))
3030
line_num += 1

‎HeadsOrTails.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def main():
1111
print("Heads: {} ({}%)".format(ht_list.count("h"), str(int(((ht_list.count("h")/len(ht_list)) * 100)))))
1212
print("Tails: {} ({}%)".format(ht_list.count("t"), str(int(((ht_list.count("t")/len(ht_list)) * 100)))))
1313
end = time.time()
14-
print("Runtime: ", (end-start))
14+
print("Runtime: ", "{:.2f}".format(end-start))
1515

1616

1717
main()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /