Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- devices_collection = {"iphone", "android", "radio", "tv", "tablet", "pc", "laptop"}
- device_name = input("Enter the device name: ")
- start_time = time.perf_counter()
- result = f"{device_name} is in the list." if device_name in devices_collection else f"{device_name} is not in the list."
- end_time = time.perf_counter()
- time_taken = end_time - start_time
- print(result)
- print(f"Time taken: {time_taken:.6f} seconds")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement