Write the following program in Python 352 Check SSN Write a

Write the following program in Python 3.5.2

(Check SSN) Write a program that prompts the user to enter a Social Security number in the format ddd-dd-dddd, where d is a digit. The program displays Valid SSN for a correct Social Security number or Invalid SSN otherwise.

Solution

SSN = raw_input(“Please enter the Social Security Number in format ddd-dd-dddd”)

chunks = SSN.split(‘-‘) //this just removes - entered with SSN

validCheck = False

if len(chunks) ==3:

                if len(chunks[0] ==3 and len(chunks[1])==2 and len(chunks[2])==4:

                  validCheck = Truw

print validCheck

Write the following program in Python 3.5.2 (Check SSN) Write a program that prompts the user to enter a Social Security number in the format ddd-dd-dddd, where

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site