Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- devices = [
- "laptop", "computer", "headphones", "tv", "charger", "phone", "speakers"
- ]
- device = input("Enter a device name: ").strip().lower()
- start_time = time.time()
- found = device in devices
- end_time = time.time()
- print("Yes")
- print(f"Found in: {end_time - start_time:.5f} seconds")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement