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
frosja888 [35]
3 years ago
12

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 progr

am displays Valid SSN for a correct Social Security number or Invalid SSN otherwise.
Computers and Technology
1 answer:
koban [17]3 years ago
3 0

ssn = input("Enter a valid Social Security number: ")

dashes = 0

nums = 0

message = "Invalid SSN"

if len(ssn) == 11:

   for x in ssn:

       if x.isdigit():

           nums += 1

       elif x == "-":

           dashes += 1

if nums == 9 and dashes == 2:

   message = "Valid SSN"

print(message)

I wrote my code in python 3.8. I hope this helps!

You might be interested in
Write a function to sum the following series:
Phoenix [80]

Answer:

<u>C program to find the sum of the series( 1/2 + 2/3 + ... + i/i+1)</u>

#include <stdio.h>

double m(int i);//function declaration  

//driver function

int main() {

int i;

printf("Enter number of item in the series-\n");//Taking input from user

scanf("%d",&i);

double a= m(i);//Calling function

printf("sum=%lf",a);

return 0;

}

double m(int i)//Defining function

{

double j,k;

double sum=0;

for(j=1;j<i+1;j++)//Loop for the sum

{

k=j+1;

sum=sum+(j/k);

}

return sum;

}

<u>Output:</u>

Enter number of item in the series-5

sum=3.550000

5 0
3 years ago
To begin importing data from an excel spreadsheet, click on the ____ tab on the ribbon.
Mamont248 [21]

Answer:

External data

Explanation:

The "external data" is one of the tabs on the ribbon. It is used for importing data from an excel spreadsheet.

Hope this helps!

3 0
3 years ago
Which of these is a cultural form? A. Art B. Food C. Clothes D. All of the above
wel
D. All of the above


Sorry If Wrong
4 0
4 years ago
Read 2 more answers
Which subunit of a heterodimeric cdk is the regulatory subunit?
Lemur [1.5K]
The answer is cyclin subunit
8 0
3 years ago
Ano ang bunga ng pagsunod sa tamang konsiyensiya?
gladu [14]

Answer:

A.

Explanation:

mapalaganap ang kabutihan

8 0
3 years ago
Read 2 more answers
Other questions:
  • What is the difference between cout and cerr?
    14·2 answers
  • Match the categories in the first column with examples in the second column.
    14·1 answer
  • Describe how computer become <br> in the next 35 year
    5·1 answer
  • Andrina writes letters that are regularly sent to hundreds of her company’s customers. Because of this, she would like for the M
    5·1 answer
  • Discuss briefly general-purpose graphicsprimitives that contain 2D graphics library.
    15·1 answer
  • What have very strong chemical bonds and cannot be reshaped when heated.​
    6·1 answer
  • How to delete Brainly account ?​
    12·1 answer
  • Under which tab would you look to find the Show in Groups and advanced sort options for messages in Outlook?
    11·2 answers
  • When you are typing data that is in a series, such as days of the week or months of the year, you can use this tool to complete
    11·1 answer
  • Frank - as the Scrum Master of a Scrum Team - is invited for a Daily Scrum meeting at 9am. The teamgets together in front of the
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!