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 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
/// Helper function for showing an adaptive alert dialog | |
/// Returns: | |
/// - true if the default action was selected | |
/// - false if the cancel action was selected | |
/// - null if the dialog was dismissed | |
Future<bool?> showAlertDialog({ | |
required BuildContext context, |
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 math import * | |
def is_prime(n): | |
if n < 2: return False | |
for i in range(2, isqrt(n)+1): | |
if n%i == 0: return False | |
return True |
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
def printll(self): | |
print("Head", end=" ") | |
node = self.__head.next | |
while node is not None: | |
print(f"-> {node.value}", end=" ") | |
node = node.next | |
print() |