6.5 LAB Checker For Integer String

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

6.

5 LAB Checker for integer string


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 access this page via Blackboard, please do so now.
Forms often allow a user to enter an integer. Write a program that takes in a string
representing an integer as input, and outputs yes if every character is a digit 0-9.
Ex: If the input is:
1995
the output is:
yes
Ex: If the input is:
42,000
or any string with a non-integer character, the output is:

user_string = input()

print(“yes”) if user_string.isdigit() else print(“no”)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy