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
Studentka2010 [4]
3 years ago
15

Write the code (from to )using for loop andif elseif statementto accept themobile phone numbersof200 residents of Dubaiasstringa

nd check if thelength of eachmobile number is10. Depending on the first 3 characters of the mobile number,display the messagefrom the table below:First 3 charactersMessage“050”, “054”, “056”Etisalat number“052”,“055”, “058”DunumberFor anyother input(if the phone number is not a ten digit number or if it does not start with any of the above digits)Not a valid mobile number
Computers and Technology
1 answer:
Ksenya-84 [330]3 years ago
3 0

Answer:

In Python:

nos = int(input("How many phone number: "))

for i in range(1,nos+1):

   phn = input("Phone Number: ")

   if not len(phn) == 10:

       print("Invalid")

   else:

       charactersMessage = phn[0:3]

       if charactersMessage in ['050', '054', '056']:

           print("Etisalat Number")

       elif charactersMessage in ['052', '055', '058']:

           print("Du Number")

       else:

           print("Invalid")

Explanation:

Prompts the user for the frequency of phone numbers to check

nos = int(input("How many phone number: "))

This iterates through the phone numbers

for i in range(1,nos+1):

This prompts the user for phone number

phn = input("Phone Number: ")

Prints invalid id number length is not 10

<em>if not len(phn) == 10:</em>

<em>    print("Invalid")</em>

If otherwise

else:

This gets the first 3 characters

   charactersMessage = phn[0:3]

Prints Etisalat number if the characters are either 050, 054 or 056

<em>    if charactersMessage in ['050', '054', '056']:</em>

<em>        print("Etisalat Number")</em>

Prints Du number if the characters are either 052, 055 or 058

<em>    elif charactersMessage in ['052', '055', '058']:</em>

<em>        print("Du Number")</em>

Prints error if otherwise

<em>    else:</em>

<em>        print("Invalid")</em>

You might be interested in
Help please<br>Who will give the answer I'll mark him/her as brainlist..​
kolbaska11 [484]

Answer:

We will be using Average function of Excel Calculation sheet.

Its Syntax in Calc sheet is : =AVERAGE (number1, [number2], ...)

or you can use =Average and then click on the first cell and drag the whole row till end and close the brackets. It will calculate the average of that row.

Once you have applied average function on first row, you can drag this cell down the column and it will replicate the same function for respective rows.

4 0
3 years ago
What is an electronic ledger that tracks mathematical data
anyanavicka [17]
Computer or calculater.hope this helps
7 0
3 years ago
Develop a program so that the output will produce the following :
hammer [34]

Answer:

 #include <iostream>

using namespace std;

int main()

{

  float radius = 5.4;

  float circumference = 2 * 3.14 * radius;

  float area = 3.14 * radius * radius;

 

  cout<<"the circumference of the circle is "<<circumference<<endl;

  cout<<"the area of the circle is "<<area<<endl;

  return 0;

}

Explanation:

Include the library iostream for using the input/output instructions.

create the main function and define the variable with value. Then,

use the formula to calculate the circumference and are of circle.

circumference = 2*\pi *radius

area = \pi * radius^{2}

here, choose \pi = 3.14

after that, display the result.

Note: All variable define in float type.

4 0
3 years ago
Select all that apply. Backstage view will grant access to change which features?
dem82 [27]
Word Option and AutoCorrect

The office Backstage view is the one place that you can manage your data and files about them like saving, printing, creating, and setting options. It is everything that is done to a file and can be accessed when you first open your MS office and clicking on file tab. In the choices provided, both of these options selected can be found in the setting options of the backstage view.


6 0
3 years ago
Python programmers use the Else statement to run code
olchik [2.2K]

Answer:

the answer is <u>True</u>

Explanation:

when you use an if statement it has to end with an else statement because the if statement is used to give opinions in a code but if the option doesn't fit the need of the function then the else statement is expected.

4 0
3 years ago
Other questions:
  • What does CPL stand for
    9·2 answers
  • The voluntary linkage of computer networks around the world is called the ______.
    7·1 answer
  • Se citește un număr natural n cu cel mult 16 cifre. Fie q numărul de cifre ale numărului n. Prin eliminarea unei singure cifre d
    5·1 answer
  • What are the benefits of maintaining you vehicle?
    11·1 answer
  • Hope fixes her mistake and comes up with this list.
    9·2 answers
  • Agile methods comprise of 45 subprocesses which are organized into eight process groups.
    10·1 answer
  • For each situation, provide a pseudocoded algorithm that would accomplish the task. Make sure to indent where appropriate.Situat
    10·1 answer
  • Write a program that multiplies two hard-coded numbers, then prints the individual numbers out and prints their product out, all
    10·1 answer
  • A facility that is pre-wired for necessary telecommunications and computer equipment, but doesn't have equipment installed, is k
    15·1 answer
  • What is the most important person and why
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!