1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lakkis [162]
3 years ago
8

Write a Python function called validateCreditCard that takes 8-digit credit card number as the input parameter (string value) an

d display whether that number is valid or not. For example,
validateCreditCard("43589795") will display "Valid credit card number"
validateCreditCard("43589795") will display "Invalid credit card number"
Computers and Technology
1 answer:
babunello [35]3 years ago
6 0

Answer:

def validateCreditCard(x):

      if type(x)==str and len(x) == 8:

           print("Valid credit card number")

      else:

          print("Invalid credit card number")

validateCreditCard("43589795")

Explanation:

Run the code on your text editor(vs code, sublime, pycharm ) you will get your desired response. If your input is not of type string and not up to 8 digit you will get the response "invalid credit card number" but if it is of type string and up to 8 digit you will get "Valid credit card number".

But remember python works with indentation so when you are transferring this code to your text editor it will run properly well.

I defined the code using the conventional pattern "def"

After defining the function you create a brackets (x) to accommodate your argument x and end it with a semi colon.  

Then i use "if" statement to make sure only string argument and 8 digit value will be accepted to print a "valid credit card". if your argument does not pass the if statement condition it will print out the else statement condition which is "Invalid credit card number"

Finally, you have to call your function and test various values.

     

   

You might be interested in
What does the word "e-business" mean?
Zepler [3.9K]
It stands for Electronic Business, a typical example of this is a online store.
4 0
3 years ago
Read 2 more answers
Consists of forging the return address on an email so that the message appears to come from someone other than the actual sender
Pavlova-9 [17]

Answer:

C. Spoofing.

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

Some examples of cyber attacks are phishing, zero-day exploits, denial of service, man in the middle, cryptojacking, malware, SQL injection, spoofing etc.

Spoofing can be defined as a type of cyber attack which typically involves the deceptive creation of packets from an unknown or false source (IP address), as though it is from a known and trusted source. Thus, spoofing is mainly used for the impersonation of computer systems on a network.

Basically, the computer of an attacker or a hacker assumes false internet address during a spoofing attack so as to gain an unauthorized access to a network.

4 0
3 years ago
A polyalphabetic cipher uses many ___
Greeley [361]

Answer:d) Mono-alphabetic substitution rules

Explanation: Poly-alphabetic cipher is the cryptography that is done by using the many alphabets in substitutional way. They are supposed to have a good security because they use cipher text alphabets for the encryption and then decrypts it.

Substitution of the alphabets is done by the rule of the mono-alphabetic substitution rules.Other given options are incorrect because they are not used in the cryptography of the alphabetic cipher. Thus option (d) is the correct answer.

3 0
3 years ago
. When a system isdelivered over time, with each delivery (release) adding tothe
dexar [7]

Answer:

A. Incremental Development

Explanation:

Great question, it is always good to ask away and get rid of any doubts that you may be having.

The answer to this question is Incremental Development, this is when the development of the system is implemented little by little as time goes on. On the other hand phase development is when a development cycle is rolled out in phases such as the brainstorming phase, Construction phase, marketing , and roll out phase. Since this development doesn't contribute to the system's functionality it is not the correct answer.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
In which step of the Systems Development Life Cycle (SDLC) are the logical and physical components defined?
QveST [7]

Answer: Systems design

Explanation: SDLC(Systems Development Life Cycle)  is the cycle that is responsible for the development of the system including several phases related to it.

The system design phase in SDLC works with the physical or hardware units and the logical reports to make a design interface. This phase makes the requirements of the cycle into design and present it for the analysis so that it can test the efficiency of it.

8 0
3 years ago
Other questions:
  • When ordering a new​ zagflatz, customers must choose the style of three major​ components, each of which has about ten variation
    6·1 answer
  • Why would it be beneficial to preview a page before printing?
    8·1 answer
  • If you want to open the Navigation pane to do a Find, what should you first click on the Home tab? Paragraph, Editing, Styles, o
    15·1 answer
  • Write a program that prompts the user to enter the number of integer numbers you need to enter, then ask user to enter these int
    5·1 answer
  • Which might be included in both your speaking outline and your preparation outline? A. Detailed descriptions of each main point
    8·1 answer
  • Who created apple and in what year was it created
    9·2 answers
  • What is the output of the following program?
    11·1 answer
  • How many of the colonists of Jamestown died before they made it to shore, due to the difficult voyage?
    15·1 answer
  • PLEASE HELP!
    14·2 answers
  • LAB: Phone number breakdown Given a long long integer representing a 10-digit phone number, output the area code, prefix, and li
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!