This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Windirstat | |
| Process Lasso |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from collections import deque | |
| stack = deque() | |
| stack.append(10) | |
| stack.append(20) | |
| stack.append(30) | |
| print(stack.pop()) # Output: 30 | |
| print(stack) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import redis | |
| r = redis.Redis(host='localhost', port=6379, db=0) | |
| print(r.ping()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import sys | |
| import time | |
| for i in range(5): | |
| print(f"\rIteration {i+1}", end='', flush=True) # Print the new value | |
| sys.stdout.write("\r") # Clear the line first | |
| time.sleep(0.2) | |
| print("\nDone!") # Move to a new line after the loop |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| MY_TOKEN = 'TESTING123@#$' | |
| class Request: | |
| def __init__(self, token, method) -> None: | |
| self.token = token | |
| self.method = method | |
| def check_authentication(func): | |
| def wrapper(*args, **kwargs): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| target_element = 1 | |
| li = [1, 2, 5, 6, 7, 8, 10, 12, 9, 3, 4, 11, 13, 17, 17, 16, 14, 15] | |
| li = sorted(li) | |
| count = 0 | |
| li_len = len(li) | |
| while True: | |
| index = len(li) // 2 | |
| if li[index] == target_element: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Assignment 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # from prettytable import PrettyTable | |
| from tabulate import tabulate | |
| # https://pyneng.readthedocs.io/en/latest/book/12_useful_modules/tabulate.html | |
| class Employee: | |
| def __init__(self, id, first_name, last_name, joined_date, position, pay) -> None: | |
| self.id = id | |
| self.first_name = first_name | |
| self.last_name = last_name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| T = int(input()) | |
| if T > 0 and T < 10: | |
| for i in range(T): | |
| try: | |
| a, b = map(int, input().split()) | |
| print(a//b) | |
| except ZeroDivisionError as e: | |
| print("Error Code:", e) | |
| except ValueError as e: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if __name__ == '__main__': | |
| n = int(input()) | |
| arr = map(int, input().split()) | |
| print(sorted(set(list(arr)), reverse=True)[1]) |
NewerOlder