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
"""A number-guessing game.""" | |
from random import * | |
# Put your code here | |
# Greet and prompt user | |
print('Howdy, what is your name?') | |
name = input('(type in your name) ') | |
print(f'{name} I\'m thinking of a number between 1 and 100. \nTry to guess my number.') |
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
function translatePigLatin(str) { | |
if (/^[^aeiou]+/.test(str)) { | |
if (str.match(/^[^aeiou]+/)[0].length === str.length) { | |
return str + 'ay'; | |
} else { | |
return str.replace(/(^[^aeiou]+)(\B[a-z]+)/, '$2$1ay'); | |
} | |
} else { | |
return str + 'way'; | |
} |
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
const denoVals = [ | |
{name: "ONE HUNDRED", val: 100}, | |
{name: "TWENTY", val: 20}, | |
{name: "TEN", val: 10}, | |
{name: "FIVE", val: 5}, | |
{name: "ONE", val: 1}, | |
{name: "QUARTER", val: 0.25}, | |
{name: "DIME", val: 0.1}, | |
{name: "NICKEL", val: 0.05}, | |
{name: "PENNY", val: 0.01} |