Skip to content

Commit 3b0fada

Browse files
committed
update
1 parent 577a2ff commit 3b0fada

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

ex-21(Check limit)

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
def check_word_count(text):
2+
# Split the text into words using whitespace as a delimiter
3+
words = text.split()
4+
# Count the number of words
5+
word_count = len(words)
6+
7+
# Check if the word count is less than 100
8+
if word_count < 100:
9+
print(f"The input has {word_count} words, which is less than 100.")
10+
else:
11+
print(f"The input has {word_count} words, which is 100 or more.")
12+
13+
# Input from the user
14+
input_text = input("Enter your text: ")
15+
check_word_count(input_text)

tempCodeRunnerFile.py

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tkcalendar

vishal.mp3

-78.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)