Ask Question
12 May, 02:41

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

+2
Answers (1)
  1. 12 May, 03:14
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers