# 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].

Question
506 views

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].

check_circle

Step 1

Python Program:

#Declare and initialize the variable

special_list = [-99, 0, 44]

#Prompt the user to give input

special_num = int(input("Enter special number: "))

#If condition to check whether the given input is in the list or not

if special_num in special_list:

#Display the statement if the special

#number is there in the special list.

print("Special number")

else:

#Display the statement if the special

#number is not there in the special list.

print("Not special number")

Step 2

Output #1:

Enter special number: 44

Special number

Output #2:

Enter special numb...

### Want to see the full answer?

See Solution

#### Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in