Ask Question

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

+4
Answers (1)
  1. 9 May, 13: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?
Find 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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers