Placeholder

ITS320 Module 2 Option 1 Creating a Python Application for string validation

$9.00

Description

Option #1: Creating a Python Application
Python has built-in string validation methods for basic data. It can check if a string is composed of alphabetical characters, alphanumeric characters, digits, etc.
str.isalnum() This method checks if all the characters of a string are alphanumeric (a-z, A-Z and 0-9).
>>> print ‘ab123’.isalnum()
True
>>> print ‘ab123#’.isalnum()
False
str.isalpha() This method checks if all the characters of a string are alphabetical (a-z and A-Z).
>>> print ‘abcD’.isalpha()
True
>>> print ‘abcd1’.isalpha()
False
str.isdigit() This method checks if all the characters of a string are digits (0-9).
>>> print ‘1234’.isdigit()
True
>>> print ‘123edsd’.isdigit()
False
str.islower() This method checks if all the characters of a string are lowercase characters (a-z).
>>> print ‘abcd123#’.islower()
True
>>> print ‘Abcd123#’.islower()
FalseSAMPLE
str.isupper() This method checks if all the characters of a string are uppercase characters (A-Z).
>>> print ‘ABCD123#’.isupper()
True
>>> print ‘Abcd123#’.isupper()
False
Assignment Instructions:
Write a Python program that performs the following tasks:
1. Read from the console an arbitrary string S of length less than 50 characters.
2. In the first output line, print True if S has any alphanumeric characters. Otherwise, print False.
3. In the second line, print True if S has any alphabetical characters. Otherwise, print False.
4. In the third line, print True if S has any digits. Otherwise, print False.
5. In the fourth line, print True if S has any lowercase characters. Otherwise, print False.
6. In the fifth line, print True if S has any uppercase characters. Otherwise, print False.
7. Develop Python code that implements the program requirements.
Assignment Deliverables:
• Submit a text file containing your Python code into the Module 2 drop box. Name your file ITS320_CTA2_Option1.py
SCREENSHOTS
SOLUTION
PAYMENT
ITS 320 Module 2 Option 1
The solution includes source code and screenshot.
Attachments [Move over files to preview content of those files]
ITS320-MODULE2-OPTION1.zip (14.45 KB)
ITS320-MODULE2-OPTION1-SCREENSHOT.png
ITS320_CTA2_Option1.py
Preview ITS320_CTA2_Option1.py
xx xxx xxxxx:
xxxxx (xxxxx)
# xxxxx xxx xxxxxx x xxx xxx xxxxxxxxxxxx
xxxxx = xxxxx
for c in S: if c.isalpha(): print (True) found = True break if not found: print (False)
# check the string S has any digits found = False for c in S: if c.isdigit():
xxxxx (xxxx)
xxxxx = xxxx
xxxxx
xx xxx xxxxx:
xxxxx (xxxxx)
Price: $9
Buy Now
Checkout
Added to cart
Add to Cart
Checkout
Added to cart
Note: We offer a discount for buyers who purchase multiple items.
You May Also Like:
ITS320 Module 1 Option 1 Create a Python Application that outputs mouse
ITS320 Module 1 Option 2 Create a Python Application that read two integers and print two lines
ITS320 Module 2 Option 2 Creating a Python Application using dictionary
ITS320 Module 3 Option 1 Creating a Program to Calculate the Value of a Ferrari
ITS320 Module 3 Option 2 : Creating a Program to Calculate Weekly Average Tax Withholding
ITS320 Module 4 Option 1 Repetition Control Structure – Five Floating Point Numbers
ITS320 Module 4 Option 2 Repetition Control Structure – Grade Statistics

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.