Advertisement
Thrist00w

q2_solkution

May 2nd, 2025
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.31 KB | None | 0 0
  1. import time
  2.  
  3. devices = [
  4.     "laptop", "computer", "headphones", "tv", "charger", "phone", "speakers"
  5. ]
  6.  
  7. device = input("Enter a device name: ").strip().lower()
  8.  
  9. start_time = time.time()
  10. found = device in devices
  11. end_time = time.time()
  12.  
  13. print("Yes")
  14. print(f"Found in: {end_time - start_time:.5f} seconds")
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement