Skip to content

Commit ae3c27b

Browse files
Add files via upload
The string should be entered using input() and assigned to a variable. Use print() twice at the end of your program. The first print() will print the string that the user entered and the second print() will display the number of characters in the string. For example, if the user entered the string "hello world", the number of characters would be 11.
1 parent 8c23c31 commit ae3c27b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Number of Characters in A String.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
user_input=str(input("Enter the string\n"))
2+
count=0
3+
for char in user_input:
4+
count+=1
5+
print(user_input)
6+
print(count)

0 commit comments

Comments
 (0)