This file contains 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
__author__ = 'tom' | |
import math | |
print([x for x in range(2, 1000) if not any([x % y == 0 for y in range(2, math.floor(math.sqrt(x))+1)])]) |
This file contains 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
__author__ = "tom" | |
def fib(n): | |
if n == 1: | |
return 1 | |
if n == 2: | |
return 1 | |
return fib(n-1) + fib(n-2) | |
print([fib(x) for x in range(1, 30)]) |
This file contains 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
__author__ = 'tom' | |
def palindrome(word): | |
if all(word[x] == word[len(word)-x-1] for x in range(0, len(word)/2)): | |
return True | |
else: | |
return False | |
print(palindrome("mock")) | |
print(palindrome("lol")) |
This file contains 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
__author__ = 'tom' | |
import sys | |
file_name = sys.argv[1] | |
source = open(file_name).readlines() | |
print(''.join(source[::-1])) |
This file contains 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
__author__ = 'tom' | |
import sys | |
from PyQt5.QtWidgets import (QWidget, QToolTip, | |
QPushButton, QApplication) | |
from PyQt5.QtGui import QFont | |
class Example(QWidget): | |
def __init__(self): |
This file contains 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
__author__ = 'tom' | |
import sys | |
from PyQt5.QtWidgets import QWidget, QPushButton, QApplication | |
from PyQt5.QtCore import QCoreApplication | |
class Example(QWidget): | |
def __init__(self): | |
super().__init__() |
This file contains 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
__author__ = "tom" | |
import sys | |
from PyQt5.QtWidgets import QWidget, QMessageBox, QApplication | |
class Example(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.init_ui() |
This file contains 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
__author__ = 'tom' | |
import sys | |
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplication | |
class Example(QWidget): | |
def __init__(self): | |
super().__init__() | |
self.init_ui() |
This file contains 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
__author__ = 'tom' | |
import sys | |
from PyQt5.QtWidgets import QMainWindow, QApplication | |
class Example(QMainWindow): | |
def __init__(self): | |
super().__init__() | |
self.init_ui() |
OlderNewer