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
cluponka [151]
2 years ago
7

You have a unique id number, which is represented by the variable id, containing a string of numbers. write a program that conti

nuously takes strings to standard input. if the string is not your id number, print "this is not your id number." if it is, print "this is your id number: " followed by the number, and terminate the loop.
Computers and Technology
2 answers:
koban [17]2 years ago
8 0

idNumber = "123456"
idNo = input("Enter the unique ID number: ")
while idNumber != idNo:
print("This is not your ID number.")
idNo = input("Enter the unique ID number: ")
print("This is your ID number: ", idNo)

Output:

sh-4.3$ python3 main.py                                                                                                                                                                                                                                                

Enter the unique ID number: 2345                                                                                                                                                                                                                                       

This is not your ID number.                                                                                                                                                                                                                                            

Enter the unique ID number: 4563                                                                                                                                                                                                                                       

This is not your ID number.                                                                                                                                                                                                                                            

Enter the unique ID number: 12345                                                                                                                                                                                                                                      

This is not your ID number.                                                                                                                                                                                                                                            

Enter the unique ID number: 123456                                                                                                                                                                                                                                     

This is your ID number:  123456

-BARSIC- [3]2 years ago
7 0

To print a unique ID number which is represented by a variable and it contains string of numbers . For this, first declare the unique ID then create a variable that take inputs from the keyboard. After this, create a loop that will match with your unique number (ID). Lastly, display a message if ID is matched then print ‘This is your ID number’ and if it is not matched then print ‘This is not your ID number’.

Further Explanation:

Code:

The complete code in python language for the given problem is shown below:

# Your unique ID number

id = "12345"

# Enter the ID  number

number = input ("Enter an ID: ")

# Loop to match the ID number with input

while id !=number:

# Print the message

print ("This is not your ID number")

number = input ("Enter an ID: ")

print("This is your ID number:", number)

Output:

Run the commands in python, the output will be looking as below:

Enter the unique ID number: 24345

This is not your ID number

Enter the unique ID number: 1345                                                    

This is not your ID number

Enter the unique ID number: 12345  

This is your ID number

Enter the unique ID number: 35645                                                

This is not your ID number

Learn more:

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011  

2. Prediction accuracy of a neural network depends on _______________ and ______________. brainly.com/question/10599832  

Answer details:

Grade: College Engineering

Subject: Computer Science and Engineering

Chapter: Python Programming

Keyword:

Python, input, output, programming, statements, if-else, loops, print, scan. while, body, main body, char, int, variables, unique, ID number, match

You might be interested in
The hypothalamus controls the anterior pituitary by means of: a. releasing hormones b. second messengers c. third messengers d.
scoundrel [369]

Answer:

a. releasing hormones

Explanation:

The hypothalamus controls the anterior pituitary by means of corticotropin-releasing hormone (CRH). The hormone CRH is encoded by the CRH gene on eighth human chromosome. The anterior pituitary in turn regulates other endocrine glands by means of Adrenocorticotrophic Hormone (ACTH). These actions form part of the Hypothalamic–pituitary–adrenal(HPA) axis which is one of the important neuroendocrine systems in humans.

7 0
3 years ago
What do I have to do to get you to cancel this subscription? I have emailed several times and every dang month I get a $10 charg
alexdok [17]
Contact the moderation team’s email
5 0
3 years ago
Files containing ____ are available from a variety of sources.
alexandr402 [8]
Important things maybe. I am in Graphic design so I know little
6 0
3 years ago
Write a cout statement so the variable sales is displayed with a precision of three decimal places, with the decimal point alway
Lilit [14]

Answer:

The statement is as follows:

cout <<fixed<< setprecision(3) <<sales;

Explanation:

Here, I assume that the variable has already been declared.

The syntax to use is:

cout<<fixed<<setprecision(n)<<variable-name;

In this case:

n = 3 --- i.e. to 3 decimal places

And the variable name is: sales

So, when implemented, the instruction is:

cout <<fixed<< setprecision(3) <<sales;

5 0
3 years ago
What does the word complacency mean ?
bulgar [2K]

Answer:

a feeling of smug or uncritical satisfaction with oneself or one's achievements.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • You work administrative assistant in an engineering firm. A co-worker constantly makes fun of the engineers by whispering commen
    13·1 answer
  • Because health and safety are important in all workplaces, not just hazardous ones, what working conditions must ALL employers p
    10·2 answers
  • A professor is working with five teams in his marketing research class. He decides to experiment with path-goal theory in helpin
    11·1 answer
  • What's another word for contact print?
    15·2 answers
  • Donna often travels around the world. When she travels, she needs to access her emails from different locations. However, to kee
    6·2 answers
  • What code do I have to use in my php if i don’t want my $_SESSION[“variablex”] to destroy? But i already have a session_destroy(
    6·1 answer
  • Anyone play Ps4 and wanna run up some warzone or Gta? Im M 16 so dont be a creep... :) ill mark brainliest if you drop gamertag
    8·2 answers
  • Computer software is regarded a bridge between the hardware and software.elaborate the statement outlining types and functions o
    10·1 answer
  • Help!!
    15·1 answer
  • Convert<br> 0.625 to binary
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!