8:36 AM Mon Mar 8
198%
Alips://learn.zy X 5.21 LAB: Small X
Home
X
?Cont Zy https://learn.zy X +
learn.zybooks.com
9
= zyBooks?
You are using an unsupported browser. Please see our systems requirements page for a list of
supported browsers.
Instructor note:
Note: this section of your textbook contains activities that you will complete for points. To ensure your
work is scored, please access this page from the assignment link provided in Blackboard. If you did not ac-
cess this page via Blackboard, please do so now.
Given a line of text as input, output the number of characters excluding spaces, periods, or commas.
Ex: If the input is:
Listen, Mr. Jones, calm down.
the output is:
21
Note: Account for all characters that aren't spaces, periods, or commas (Ex: "r", "2", "!").
308232.1370954.qx37qy7
LAB
ACTIVITY
4.14.1: LAB: Count input length without spaces, periods, or commas
main.py
1 user_text = input()
2
3 count = 0
4
5 for x in user_text:
6
if not(x in ".",'):
7 count += 1
8
9 print(count)
2/10
X
Develop mode Submit mode
Run your program as often as you'd like, before submitting for grading
input values in the first box, then click Run program and observe the pi
second box.
Enter program input (optional)