Ask Question
13 July, 22:25

Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored in the list special_list = [-99, 0, or 44]. Sample output with input: 17

+3
Answers (1)
  1. 13 July, 23:19
    0
    Following are the program in Python language

    special_list = [-99, 0, 44] # as mention in the question

    special_num = int (input ()) # taking the user input ...

    if special_num not in special_list: # checking the condition

    print ('not Special number') #display message

    else:

    print ('special number') #display message

    Output:

    523

    not Special number

    -99

    special number

    Explanation:

    Following are the description of the program.

    Declared an array special_list and store integer value. Read the integer value by using input function and store them into special_num variable. Check the condition if number exits in array it print special number otherwise not Special number.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored in the list ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers