Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

What are the functions of top management?

Answered: 1 week ago

Question

Bring out the limitations of planning.

Answered: 1 week ago

Question

Why should a business be socially responsible?

Answered: 1 week ago

Question

Discuss the general principles of management given by Henri Fayol

Answered: 1 week ago