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
class Invoice: | |
def __init__(self, client, total): | |
self._client = client | |
self._total = total | |
def formatter(self): | |
return f'{self._client} owes: ${self._total}' | |
@property |
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
class Invoice: | |
def greeting(self): | |
return 'Hi there' | |
inv_one = Invoice() | |
print(inv_one.greeting()) |
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
class Invoice: | |
def __init__(self, client, total): | |
self.client = client | |
self.total = total | |
def formatter(self): | |
return f'{self.client} owes: ${self.total}' | |
google = Invoice('Google', 100) |
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
class Calculator(object): | |
def add(self, x, y): | |
return x + y |
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 unittest | |
import calculator as c | |
class TddInPythonExample(unittest.TestCase): | |
def test_calculator_add_method_returns_correct_result(self): | |
calc = c.Calculator() | |
result = calc.add(2,2) | |
self.assertEqual(4, result) |
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
Creating a virtualenv for this project… | |
Using /Users/admin/.pyenv/versions/3.6.3/bin/python3 to create virtualenv… | |
⠋Running virtualenv with interpreter /Users/admin/.pyenv/versions/3.6.3/bin/python3 | |
Using base prefix '/Users/admin/.pyenv/versions/3.6.3' | |
New python executable in /Users/admin/.local/share/virtualenvs/python-env-Fa5mmZ2G/bin/python3 |
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
var guess = prompt("Guess a number 1-5"); | |
var num1 = "1"; | |
var num2 = "2"; | |
var num3 = "3"; | |
var num4 = "4"; | |
var num5 = "5"; | |
var num6 = ""; | |
var num7 = numberRange(6, 51); | |
function numberRange(start, end) { |
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
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<meta charset='UTF-8'> | |
<title></title> | |
<style> | |
img { | |
width: 400px; | |
} |
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
<!DOCTYPE html> | |
<html lang='en'> | |
<head> | |
<meta charset='UTF-8'> | |
<title></title> | |
<style> | |
.hideElement { | |
visibility: hidden; | |
} |
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
var ready, set_positions; | |
ready = void 0; | |
set_positions = void 0; | |
set_positions = function() { | |
$('.card').each(function(i) { | |
$(this).attr('data-pos', i + 1); | |
}); |