Question: Python 3.6.4 You have been asked to develop a method of analyzing the security PINs your customers use for their ATM and debit cards. Since

Python 3.6.4

You have been asked to develop a method of analyzing the security PINs your customers use for their ATM and debit cards. Since all PINs are 4-digit Integers, youve decided to write a Python function that calculates the weight of a PIN. To accomplish this your program must perform the following tasks: 1. Display a description of the programs purpose 2. Prompt the user for a 4-digit PIN 3. Calculate the sum of the absolute difference between each digit 4. Display the result

There are 2 functions and multiple parts to this program:

The main() function starts the program

# Display a description of the programs purpose

# Prompt the user for a 4-digit PIN

# Call the weight() function providing the 4-digit PIN as an argument

# The weight() function requires one parameter - an Integer

# Convert the Integer to a String

# Initialize variables

# Setup a for loop that uses the digits as a sequence

# Sum the differences between each digit in the Integer

# Print the calculated weight of the Integer

# Call the main() function

Example of input/output:

Python 3.6.4 You have been asked to develop a method of analyzing

Examples of Input/ Output >>>main() This program determines the'weight' of a 4-digit PIN by calculating the sum of the absolute difference between each digit Enter the PIN: 1234 The PIN 1234 has a weight of: 3 >>> main ) This program determines the weight' of a 4-digit PIN by calculating the sum of the abaolute difference between each digit Enter the PIN: 9090 The PIN 9090 has a weight of: 27

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!