Question: Python help! Hi there I'm working on a problem that states : You work for the Bank and have been asked to develop a method

Python help! Hi there I'm working on a problem that states :

You work for the Bank and 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.

These are the instructions

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 interger

I have no idea how to create the for loop to do this. this is what i have so far

#Program description print("This program was developed to to analyze security PINs our customers use for their ATM and personal debit cards.")

#Gathering Pin information pin_number = input("Please input the 4 digit PIN: ") print(" To confirm the pin number is " , pin_number ,".")

#Calling the weight function weight(pin_number)

I'm a super beginner at this and have been trying to find some resources but i'm confused on what im supposed to do with a for loop :/ thanks!!

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!