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]
3 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]3 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]3 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
Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;
ivanzaharov [21]
That's correct.

Same goes for -=  *=  and  /=

It essentially just means "Do this, to this variable".


sum += 7  "Add 7 to sum"
result *= 10  "Multiply result by 10"
So on, and so forth.
4 0
3 years ago
BRAINLYEST IF CORRECT!!! What is the special feature of the View Side by Side command?
xeze [42]

<u> Allows you to see two parts of the same worksheet side by side</u>

<u>Option: B</u>

<u>Explanation:</u>

The View Side by Side command helps to see the two documents side by side in Word. When using this feature, both the documents open at the same time in different windows side by side.

To view this, click the View tab in Word and then click the View side by side button. Now the document opens in two windows with side by side views. This is used to compare the documents. In case, if we want to disable this view, click the 'View Side by Side' button again so that it comes to the normal view.

6 0
3 years ago
Read 2 more answers
In round-robin scheduling,a) the time quantum should be larger than the context switch time. b) the time quantum should be as sm
pickupchik [31]

Answer: d. the time quantum should be as small as possible.

Explanation: Round robin is a CPU scheduling algorithm. If the time quantum is extremely small, number of context switches is very high, round robin scheduling will be same as processor sharing algorithm. Then the algorithm is good. Very large time quantum will make response time of processes too much which may not be tolerated in interactive environment.

3 0
3 years ago
What is output when the CarTest application is run? Why?
erik [133]

Answer:

red

Explanation:

public class CarTest {

public static void main(String[] argvs) {

//below line will create an object of CarTest class Object

CarTest carTest = new CarTest();

//This will call runDemo method

carTest.runDemo();

}

public void runDemo() {

//Below line will create an object of Car class  with color blue and 4 wheel

Car c = new Car("blue", 4);

//Bellow Line will change the color from blue to red, see the logic writteen in chnageColor method definition

changeColor(c, "red");

//Below line will print the color as red

System.out.println(c.getColor());

}

public void changeColor(Car car, String newColor) {

//This line will set the color as passed color in the car object

car.setColor(newColor);

}

}

5 0
3 years ago
How can knowing internal and external parts of computer help me
mafiozo [28]
Going over parts of a computer and how it functions will help you understand all the vital components that make up a computer.
8 0
3 years ago
Other questions:
  • What are the two different frequencies WiFi operates on?
    9·2 answers
  • Universal Containers needs to add an additional recipient to a workflow email alert that isfired from the case object. What type
    6·1 answer
  • If you're sending an email from your laptop to a classmate the laptop is the
    11·1 answer
  • HELP QUICKLY!!! IF YOUR RIGHT I'LL MARK YOU BRAINLIEST
    15·2 answers
  • Power point presentation make use of pages known as
    9·2 answers
  • The NVCC college professor receives frequent emails disguised as official business emails. They may be requests to reset a passw
    10·2 answers
  • Write a program that first gets a list of integers from input. The input begins with an integer indicating the number of integer
    9·1 answer
  • A trace table is used for
    5·2 answers
  • 4. Compute the following additions
    7·1 answer
  • Roles of computer in business areas​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!