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
from array import * | |
a = array('i', [20, 18, 23, 43]) | |
b = 0 | |
for i in a: | |
b += i | |
print(b) |
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
from array import * | |
a = array('i', [20, 15, 5]) | |
b = 0 | |
for i in a: | |
if i > b: | |
b = i | |
print(b) |
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
from array import * | |
a = ["Orange", "Apple", "Banana", "Grapefruit", "Pear"] | |
b = "" | |
for i in a: | |
if len(i) > len(b): | |
b = i | |
print(b) |
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
a = ["red", "blue", "red", "red", "yellow"] | |
b = 0 | |
for i in a: | |
if i == "red": | |
b += 1 | |
print(b) |
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
a = [2, 17, 24, 6, 7, 29, 11, 10] | |
b = [] | |
for i in a: | |
if i > 10: | |
b.append(i) | |
print(b) |
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
number = 10 | |
non_number = "11" | |
print(number) | |
print(non_number) | |
total = number + int(non_number) | |
print(total) |
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
class Sheep: | |
name="" | |
species="" | |
legs=0 | |
sheep = Sheep() | |
sheep.name = "Brian" | |
sheep.species = "Sheep" | |
sheep.legs = 4 |
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
curl -s https://raw.github.com/xdissent/ievms/master/ievms.sh | IEVMS_VERSIONS="10" bash |
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
CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { | |
var htmlFound = CodeMirror.modes.hasOwnProperty("xml"); | |
var htmlMode = CodeMirror.getMode(cmCfg, htmlFound ? {name: "xml", htmlMode: true} : "text/plain"); | |
var aliases = { | |
html: "htmlmixed", | |
js: "javascript", | |
json: "application/json", | |
c: "text/x-csrc", | |
"c++": "text/x-c++src", |
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
<script> | |
// Include the UserVoice JavaScript SDK (only needed once on a page) | |
UserVoice=window.UserVoice||[];(function(){var uv=document.createElement('script');uv.type='text/javascript';uv.async=true;uv.src='//widget.uservoice.com/7CG8E4U5kiudcVZQO1KgOg.js';var s=document.getElementsByTagName('script')[0];s.parentNode.insertBefore(uv,s)})(); | |
// | |
// UserVoice Javascript SDK developer documentation: | |
// https://www.uservoice.com/o/javascript-sdk | |
// | |
// Set colors |
OlderNewer