blob_id
stringlengths
40
40
repo_name
stringlengths
5
127
path
stringlengths
2
523
length_bytes
int64
22
545k
score
float64
3.5
5.34
int_score
int64
4
5
text
stringlengths
22
545k
7da6fd99bc0a65311d81dfa0946edf3921a121ad
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_407.py
538
4.0625
4
def main(): width = int(input("Please enter the width of the box: ")) height = int(input("Please enter the height of the box: ")) outlineSym = input("Please enter a symbol for the box outline: ") fillSym = input("Please enter a symbol for the box fill: ") for h in range(0, height): for w in...
cbfecfe82a40ea16f66f50bf4bc02e9ef1a069c4
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_444.py
665
4.03125
4
def main(): width = int(input("Please enter the width of the box: ")) height = int(input("Please enter the height of the box: ")) outlineSymbol = input("Please enter a symbol for the box outline: ") fillSymbol = input("Please enter a symbol for the box fill: ") for h in range(height): if(h =...
f3fc99aa58bb857b66fe794eb9da3bcc09e62253
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_254.py
462
4.125
4
def main(): width = int(float(input("Please enter the width of the box: "))) height = int(float(input("Please enter the hieght of the box: "))) outline = input("Please enter a symbol for the box outline: ") fill = input("Please enter a symbol for the box fill: ") EDGE = 2 height=height-EDGE ...
41669cf282bd4afa08e42abaef9651e42d94f6dc
MAPLE-Robot-Subgoaling/IPT
/src/web/hw3_69.py
573
4.15625
4
def main(): FREEZE = 0 BOIL = 100 CONVERT = 273.15 temp = float(input("Please enter the temperature: ")) print("Please enter the units...") units = str(input("Either 'K' for Kelvin or 'C' for Celcius: ")) if units == 'K' : tempCel = temp - CONVERT else : tempCel = t...
e8fae662feeb6aa590fe33becf210da929c7a8ad
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_348.py
460
4.15625
4
def main(): width = int(input("Please enter the width of the box: ")) height = int(input("Please enter the height of the box: ")) symb1 = input("Please enter a symbol for the box outline: ") symb2 = input("Please enter a symbol for the box fill: ") width1 = width - 2 fill = symb2 *width1 out...
afeafa3b4267e96a9be0539abfaa626da21f9455
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_174.py
558
4.3125
4
def main(): userHeight = int(input("Please enter a positive integer that will serve as the starting height for the hailstone: ")) print("Hail height starts at", userHeight) while userHeight != 1: if userHeight % 2 == 1: userHeight = int((userHeight * 3) + 1) print("Hail heigh...
83dfbf3cbd2f80f48c06dd7763f886026f23ac2d
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_135.py
794
4.125
4
def main(): width = int(input("What do you want the width of the box to be? ")) height = int(input("What do you want the height of the box to be? ")) outline = str(input("Enter the symbol you want the outline to be: ")) fill = str(input("Enter the symbol you want the filling of the box to be: ")) pr...
8a4dfd706d16db0a3a5d148d11ba2399def19641
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_118.py
940
4.1875
4
def main(): SOLID_TEMP_CELSIUS = 0 GAS_TEMP_CELSIUS = 100 SOLID_TEMP_KELVIN = 273.15 GAS_TEMP_KELVIN = 373.15 tempNum = float(input("Please enter the temperature: ")) degreeType = input("Please enter 'C' for Celsius or 'K' for Kelvin: ") if (degreeType == "C"): if (tempNum <= SOLID_TE...
335e6efc58aed21929c3eb4982bcacb78343b2ed
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_159.py
442
4.0625
4
def main(): temperature=float(input("Please enter the temperature: ")) scale=str(input("Please enter 'C' for Celcius, or 'K' for Kelvin: ")) if scale=='k': temperature=(temperature-273.15) if temperature>=100: print("At this temperature, water is a gas.") elif temperature>0: ...
31c4258373d73681e8d1021fb4fac4d42105c0ca
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_421.py
743
4.15625
4
def main(): temp=float(input("Please enter the temperature: ")) scale=input("Please enter 'C' for Celcius, or 'K' for Kelvin: ") if temp <= 0 and scale == "C": print("At this temperature, water is a solid.") elif temp > 0 and temp < 100 and scale == "C": print("At this temperature, water...
6dfe0293e894534bf993ae70f3a1f3a78e7e9d15
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_222.py
399
4.3125
4
def main(): height = input("Please enter the current height of the hailstone: ") height = int(height) while(height > 1): height = int(height) print("The hailstone is at height",height) if(height % 2 == 0): height /= 2 elif(height % 2 != 0): height *= 3...
dae3c37bca2ad430eabd80d5f763b520b214ab5e
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_158.py
679
4.125
4
def main(): temp =float(input("please enter a temperature ")) unit = input("please enter 'C' for celsius or 'K' for kelvin ") if unit=="C": if temp <0: print("At this temperature, water is a solid") elif temp >100: print("At this temperature, water is a gas") elif temp >0 ...
71bc91e8c4ed40169539728b97f99fc0b18170d1
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_062.py
516
4.28125
4
def main(): hailStormNum = int(input("Please insert a positive integer, which is the starting height of the hailstorm: ")) while hailStormNum != 1: if hailStormNum % 2 == 0: hailStormNum = hailStormNum / 2 hailStormNum = int(hailStormNum) print (hailStormNum) ...
c0f097c1127535d5c1cded6ee0768643e39edc61
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_459.py
667
4.03125
4
def main(): userTemp = float(input("Please enter the temperature: ")) userConvert = str(input("Please enter 'C' for Celsius, or 'K' for Kelvin: ")) if (userTemp <= 0.0 and userConvert == 'C') or (userTemp <= 273.2 and userConvert == 'K'): print("At this temperature, water is a [frozen] solid.") ...
fa8c9ce4d24107ef89ca7f489588310acabd0aaa
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_228.py
553
4.0625
4
def main(): width= int(input("Please enter the width of the box:")) height= int(input("Please enter the height of the box:")) sym= input("Please enter a symbol for the box outline:") sym1= input("Please enter a symbol for the box fill:") for row in range(height): for col in range(width): ...
3d058d40b6cdf934c179e90a21736655f4f9ebf7
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_079.py
659
4.0625
4
def main(): drawBox() def drawBox(): width = int(input("What is the width of the box? ")) height = int(input("What is the height of the box? ")) outline = input("What symbol would you like for the outline? ") fill = input("What symbol would you like for the fill? ") row = "" for y in range(h...
c2865ffd41f13fe9025094fdf6b7a0de4b384e04
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_207.py
697
4.125
4
def main(): userTemp = float(input("Please enter the temperature: ")) unitScale = input("Please enter 'C' for Celsius, or 'K' for Kelvin: ") if unitScale == "C": if userTemp <= 0: print("At this temperature, water is a solid.") elif userTemp >= 100: print("At this tem...
3a1ecc693d3970dc2a873049a1a7c74882a3bf7d
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_289.py
717
3.96875
4
def main(): temperature=float(input("Please enter the temperature: ")) degree=str(input("Please enter 'C' for Celsius and 'K' for Kelvin: ")) if degree == "C" and temperature <= 0: print("At this temperature water is a (frozen) solid") exit() elif degree == "C" and temperature >= 100: ...
6d99ddfa0e550e40ed5332c54493d4f5a6dc49b4
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_337.py
807
4.125
4
def main(): temperature = float(input('Please enter the temperature: ')) scale = input('Please enter C for Celsius, or K for Kelvin: ') if (temperature <= 0) and (scale == 'C'): print ('At this tmeperature, water is a (frozen) solid.') elif (temperature >= 100) and (scale == 'C'): print ...
60050fbfe1d39a9e0ad38e9908a0f8fcba491fe1
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_233.py
834
4.15625
4
FREEZING_POINT_OF_CELSIUS= 0 BOILING_POINT_OF_CELSIUS = 100 FREEZING_POINT_KELVIN = 373.16 BOILING_POINT_KELVIN= 273.16 def main(): temp= float(input("Please enter the temperature:")) temp1= (input("Please enter 'C' for Celsius, or 'K' for Kelvin:")) if temp1 =="C": if temp > 0 and temp < 100: ...
2c92980b2b3d805d6227c49c796507ce79b88b81
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_374.py
486
4.125
4
def main(): width = int(input("Please enter the width of the box: ")) height = int(input("Please enter the height of the box: ")) symbol = input("Please enter the symbol for the box outline: ") filling = input("Please enter the symbol for the box filling: ") fillWidth = width - 2 for box in rang...
9373cdab167dcceb5ebe6e17befcac16e323f188
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_098.py
515
3.96875
4
def main (): height = int (input ("Please enter the height of the box: ")) width = int (input ("Please enter the width of the box: ")) symOut = input ("Please enter a symbol for the outline: ") symFill = input ("Please enter a box fill: ") controlOuter = (width -1) controlFill = 0 for w in...
f8dbdd0aea1bdeab5cea02a644316aab036d792f
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_062.py
599
4.0625
4
def main(): width = int(input("Please enter the width of the box: ")) height = int(input("Please enter the height of the box: ")) outline = input("Please enter a symbol for the box outline: ") fill = input("Please enter a symbol for the box to fill: ") if(height > 0 and width > 0): print(out...
fdf6fbdf2f21fe305e544a367b705a2eead1d2dc
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_123.py
598
4.125
4
def main(): index = 0 widthPrompt = int(input("What is the width of the box? ")) heightPrompt = int(input("What is the height of the box? ")) outsideSymbol = str(input("What character is the outside of the box made of? ")) insideSymbol = str(input("What character is the inside of the box made of? ")...
1c7b1626afbfc8b6532ebf8a3df788d72212883d
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_295.py
476
4.09375
4
def main(): width=int(input("Please enter the width of the box: ")) height=int(input("Please enter a height of the box: ")) outline=str(input("Please enter a symbol for the outline: ")) fill=str(input("Please enter a symbol fo the box fill: ")) if (width==1 and height==1): print(outline) ...
06aacf7cae98172f9e640d6337a9202c056d4e62
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_322.py
662
3.984375
4
def main(): temprature = float(input("Please enter the temprature: ")) tempChoice = input("Please enter 'C' for Celsius, or 'K' for Kelvin: ") if tempChoice == "C": if temprature <= 32: print("At this temprature, water is (frozen) solid") if 32 < temprature < 100: print("At this temprature, water is liqui...
ed73fe8c60ef779c7b84a958b8407319b38b2a2f
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_215.py
636
4.09375
4
def main(): width = int(input("Please enter the width of the box: ")) height = int(input("Please enter the height of the box: ")) outlineSymbol = input("Please enter a symbol for the box outline: ") fillSymbol = input("Please enter a symbol for the box fill: ") temp = "" for x in range(0, height...
3ac6d6c0fe6c50034268b5aeda0adc15a02305cd
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_299.py
529
4
4
def main(): widthBox = int(input("Please enter the width of the box: ")) heightBox = int(input("Please enter the height of the box: ")) boxOutline = input("Please enter a symbol for the box outline: ") boxFill = input("Please enter a symbol for the box fill: ") width = widthBox - 2 for i in rang...
55925a346eea381daf5536042176d56798f81be5
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_456.py
486
4.03125
4
def main() : boxWidth = int(input("Enter the width of a box: ")) boxHeight = int(input("Enter the height of a box: ")) boxSymbolOutline = input("Enter a symbol to outline a box: ") boxSymbolFill = input("Enter a symbol to fill a box: ") for w in range(0, boxHeight): if w > 0 and w != boxHe...
5fb11d51e1db3056ea22cb0e0707eec1f63ce819
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_441.py
787
4.09375
4
def main(): temp = 0.0 which = "" temp = float(input("What is the value of the temperature?")) which = input("Is this in Celcius or Kelvin? (C/K)") cels = "C" kelv = "K" if which == cels: if temp <= 0: print("At this temperature, water is a solid.") if (temp > 0) ...
8e84afae956c9fc84ff7384bc328f0c194332fc7
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_085.py
768
3.953125
4
def main(): temp=float(input("Enter a temperature: ")) kc=input("Is that in Kelvin K or Celcius C? ") if kc=="C": if temp<=0: print("At this temperature, water is soild.") elif temp>=100: print("At this temperature, water is gas.") ...
fa2c9b4e50d08505b1992c319c2fff86781a5d26
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_179.py
756
4.15625
4
def main(): GAS_C = 100 LIQUID_C = 60 GAS_K = 373.15 LIQUID_K = 333.15 temp = float(input("Please enter the temperature ")) unit = input("Please enter 'C' for Celsius, or 'K' for Kelvin: ") if unit == 'C': if temp > GAS_C: print("At this temperature, water is a gas") ...
95d8cc3d61617d2bdae5c8339d0963acac2bc1b8
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_447.py
417
4.25
4
def main(): startingHeight=int(input("Please enter the starting height of the hailstone:")) while startingHeight>1: print("Hail is currently at Height",startingHeight) if startingHeight % 2==0: startingHeight=startingHeight/2 elif startingHeight % 2==1: startingHe...
3f7e318da7c059e17a7e31761311b49123d30291
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_425.py
709
4.125
4
def main (): temp = (float (input ("What is the temperature: "))) scale = (str (input ("Please enter 'C' for Celsius or 'K' for Kelvin: "))) if (scale == 'C'): if (temp >= 100): print ("At this temperature, water is a gas.") elif (temp <= 0): print ("At this temperatu...
4a1da1920e9104e788f9cb5f5f7aaedb108e9da5
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_260.py
121
4
4
def main(): hailstone = input("Enter the starting height: ") even = hailstone // 2 odd = (hailstone * 3) + 1
5effce441d70825055564facb90ecad62729592d
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_027.py
643
3.984375
4
def main(): temp =float(input("Please enter the temperature: ")) state= input("Please enter 'C' for Celsius, or 'K' for Kelvin: ") if state=="C": if temp<=0: print("At this temperature, water is a solid (frozen)") elif temp>100: print("At this temperature, water is a gas") else: p...
ffcb1ccc05eb3ccf15ab301e9d5670842eba5f49
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_394.py
558
4.0625
4
def main(): width = int(input("Please enter the width of the box: ")) height = int(input("Please enter the height of the box: ")) symbolOutline = input("Please enter a symbol for the box outline: ") symbolFill = input("Please enmter a symbol for the box fill: ") heightList = range(0, height - 2) ...
84504ced69b52147fdcc671ce10cd68d71e498f2
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_054.py
481
4.125
4
def main(): EVEN = 0 ODD = 1 height = int(input("Please enter starting height of the hailstorm: ")) print("Hail is currently at height" , height) while height !=1: if height % 2 == EVEN: height = height // 2 print("Hail is currently at height" , height) el...
f13464818bcf71675af3bfbd72adb644bb82aa0e
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_295.py
582
4.0625
4
def main(): userNum = int(input("Please enter the starting height of the hailstorm: ")) currHeight = 1 dRemainder = userNum % 2 print("Hail is currently at height", userNum) while userNum != currHeight: if dRemainder == 0: userNum = int(userNum / 2) print("Hail is cur...
35127dcb844ddab6735990e39e85dbb467ee3933
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_106.py
450
3.890625
4
def main(): temp = float(input("WHAT IS TEMP")) if (input("SHELSHIUS OR KELVIN CLEIN") == "K"): if (temp >= 375.15): print("very gassy") elif (temp <= 273.15): print("very solid") else: print("very liquidy") else: if(temp >= 100): ...
c7c6cf60781c3541d6d56ba435aa78f8f969edbc
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_029.py
775
4.125
4
def main(): temp = float(input("Please enter the temperature: ")) letter = input("Please enter 'C' for Celsius or 'K' for Kelvin: ") if temp <= 0 and letter == 'C': print("At this temperature, water is a (frozen) solid.") elif temp >= 1 and temp <= 99 and letter == 'C': print("At this te...
afe7ee205cf7b158440d293c36ea58dc518e8f0f
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_279.py
719
4.09375
4
def main(): width = (int(input("Please enter the width of the box: "))) height = (int(input("Please enter the height of the box: "))) widthList = range(width) heightList = range(height) outline = input("Please enter a symbol for the box outline: ") fill = input("Please enter a symbol for the box...
e80b0695f64f733763171768209cb8d15df416dc
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_134.py
362
4.15625
4
def partFour(): stoneHeight = int(input("What is the hailstone's height? \n")) while stoneHeight != 1: print("Current stone height: " + str(stoneHeight)) if(stoneHeight % 2 == 0) : stoneHeight /= 2 else: stoneHeight = stoneHeight * 3 +1 print("Stone stopped at...
6ee976cc3bab4e98489059e23009ed4f722ecb8f
MAPLE-Robot-Subgoaling/IPT
/data/HW5/hw5_078.py
427
4.1875
4
width = int(input("Please enter width: ")) height = int(input("Please enter height: ")) symbol_outline = input("Please enter a symbol for the outline:") symbol_fill = input("Please enter a symbol for the fill:") def main(): forl_row = symbol_outline*width mid_row = symbol_outline+(symbol_fill*(width-2))+symbol...
1c5c9abdc59ed57e5213d37b8e9d541ee5b73de6
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_043.py
766
4.125
4
def main(): enterTemp = float(input("Please enter the temperature: ")) typeTemp = input("Please enter 'C' for Celsisus, or 'K' for Kelvin: ") if typeTemp == "K" and enterTemp >= 373.16: print("At this temperature, water is a gas.") elif typeTemp == "K" and enterTemp <= 273.16: print("At ...
dbb76edf02c9c3082671fd89df2bcdd9220a2bb6
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_028.py
790
4.125
4
def main(): unit = input("What unit are you using, enter 'C' for celcius or 'K' for Kelvin") temp = float(input("What is the temperature?")) if (temp <= 0) and (unit == "C") : print("At this temperature, water is a (frozen) solid") elif (temp >= 100) and (unit == "C") : print("At this te...
5991c2fbf4a1a987cde366a7a784d1db12fdffc5
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_431.py
550
4.21875
4
def main(): currentHeight = int(input("Please enter the starting height of the hailstone: ")) print("Hail is currently at height",(currentHeight)) while currentHeight != 1: if (currentHeight % 2) == 0: print("Hail is currently at height", currentHeight / 2) currentHeight = (c...
f6c13e0b0478f843c4ab72ff4689aaad93b24764
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_030.py
393
4.28125
4
STOP_HEIGHT = 1 def main (): hailHeight = int ( input ("Please enter the starting height of the hailstone: ")) while hailHeight != STOP_HEIGHT: if hailHeight % 2 == 0: print ("Hail is currently at", hailHeight) hailHeight = hailHeight // 2 else: print ("Hail is currently at", hailHeight) hail...
09632cb074fb96b7fd7085474afdddcb5b4c5865
MAPLE-Robot-Subgoaling/IPT
/data/HW4/hw4_330.py
249
4.125
4
def main(): num = int(input("Enter a positive integer: ")) while (num > 1): print("Hail is currently at height " + str(num) ) if( num % 2 == 0): num = num // 2 else: num = (num * 3) + 1 main()
f20872e50a04cfe8ecf00603cd58697ca47bda6a
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_037.py
782
4.125
4
def main(): temp = float(input("Please enter your temperature: ")) scale = input("Please enter 'C' for Celsius, or 'K' for Kelvin: ") if scale == "C" and temp >= 100: print("At this temperature, the water is a gas.") elif scale == "C" and (temp <100 and temp >0): print("At this...
bc1e5a01b8225fc75c5db319ff1b92eb3fea6321
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_372.py
887
4.09375
4
SOLID_CEL = 0 SOLID_KEL = 273.16 GAS_CEL = 100 GAS_KEL = 373.16 def main(): temp = float(input("Please enter the temperature: ")) tempScale = input("Please enter 'c' for Celcius, or 'k' for Kelvin: ") if(tempScale == 'c'): if(temp <= SOLID_CEL): print("At this temperature, water is a (f...
bab242cced1e1ad5251f1876544fa92f2c8f4c73
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_359.py
1,070
4.3125
4
temp = float(input("Please enter the temperature: ")) scale = input("Please enter 'C' for Celsius, or 'K' for Kelvin: ") MELTING_POINT_C = 32 BOILING_POINT_C = 100 MELTING_POINT_K = 273.15 BOILING_POINT_K = 373.15 def main(): if scale == "C": if temp >= 0 and temp < MELTING_POINT_C: ...
01b05cbd8d8d28ea8622b6749a00820aadb64050
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_082.py
778
4.09375
4
def main(): temp = int(input("Please enter the temperature: ")) tempType = input("Please enter 'C' if celsius or 'K' if kelvin: ") if(tempType == 'C'): if(temp<=0): print("At this temperature, water is solid") elif(temp>0 and temp<100): print("At this temperature, wat...
c75d93e681c3249f20724da3ac8f6719b683021f
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_332.py
743
4.125
4
def main(): temp = float(input("What is the temperature in degrees? ")) scale = input("What is the scale: Celsius (C) or Kelvin (K)? ") if scale == "C": if temp <= 0: print("At this temperature, water is a solid.") elif (temp > 0) and (temp < 100): print("At this temp...
0eb4be20b6512b4652c20a39b17e828f3659b886
MAPLE-Robot-Subgoaling/IPT
/data/HW3/hw3_329.py
842
4.25
4
def main(): temperature = float(input("Please enter the temperature:")) units = input("Please enter 'C' for Celcius or 'K' for Kelvin:") if units == "K": ctemp = temperature - 273.2 if ctemp <= 0: print ("At this temperature, water is a (frozen) solid.") elif ctemp > 0 an...
2b6f9681edbca0d3c5a4423f03d5153a78bc5f48
NathanCarlos/cursopyhtonbasico
/response.py
1,043
3.5625
4
import numpy as np # First 20 countries with employment data countries = np.array([ 'Afghanistan', 'Albania', 'Algeria', 'Angola', 'Argentina', 'Armenia', 'Australia', 'Austria', 'Azerbaijan', 'Bahamas', 'Bahrain', 'Bangladesh', 'Barbados', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bhutan', 'Bol...
f6a1eb4798d263b07bee5f19f1d224cd41439b39
NathanCarlos/cursopyhtonbasico
/entrada-saida.py
368
3.890625
4
#Tipando input. idade = int(input('Qual sua idade? ')) nome = str(input('Qual seu nome?')) altura = float(input('Qual sua altura?')) frase = nome + ' tem ' + str(idade) + ' anos ' + 'e ' + str(altura) + ' de altura' print(nome, 'tem', idade, 'anos', 'e', altura, 'de altura.') ''' Tipando a entrada de dados e...
776ba14643c38f8c4fa90f1ded7d313d74d306b8
sabias-del/TrainBrainPython
/Pickle_хранениеДанных.py
617
3.5625
4
import pickle # имя файла с покупками который мы сохраняли или любой лист shoplistfile = 'shoplist.data' # список покупок shoplist = ["яблоко", "манго", "морковь"] # запись в файл a = open(shoplistfile, "wb") pickle.dump(shoplist, a) # помещаем обьект в фаил a.close() del shoplist # уничтожаем переменную shoplist ...
299a71e6e3a87d14fbc031789b76b0907d2bfcf5
sabias-del/TrainBrainPython
/list_comprehension.py
456
4.25
4
# Генераторы списков listone = [2, 3, 4] listtwo = [2 * i for i in listone if i > 2] print(listtwo) # Передача кортежей и словарей в функции def powersum(power, *args): """Возвращает сумму аргументов, возведённых в указанную степень.""" total = 0 for i in args: total += pow(i, power) return ...
ea5f650a70964389c933cfa5cc95a21fe3cd340c
kazma89/Python_Data_Struction
/exercise10.2/exercise10.2.py
488
3.640625
4
count = dict() name = input("Enter file:") if len(name) < 1 : name = "mbox-short.txt" handle = open(name) for text in handle : if text.startswith('From ') : email = text.find(':') time = text[email-2:email] hours = time.split() for h in hours : count[h] = count.get(h,0)+...
8563317c165d019fb1519198e69eafdf0223cf32
ryan-vas/ExemplosPython
/Exemplo1.py
218
4.09375
4
""" Faça um programa que obtenha um valor inteiro digitado pelo usuário, Calcule e informe o dobro desse número. """ valor = int (input('Digite um Número: ')) print ('Dobro do número digitado:',valor*2)
282c38e4ae01e1ff062d36be066558b6ce0d1958
chuckoy/monopoly-cash-tracker
/monopoly/utils.py
130
3.5
4
def quantify(amount, quantifier): amount = float(amount) if quantifier == "M": amount *= 1000.0 return amount
b62367ec36ee1d02996d3d0835c43534ec388904
bwtakacy/ProjectEuler
/7.py
393
3.90625
4
''' Problem 7 10001st prime What is the 10001st prime number ''' from math import sqrt MAX=200000 def is_prime(num): for i in range(2, int(sqrt(num))+1): if num % i == 0: return False return True if __name__ == '__main__': N = int(input('Enter the number: ')) primes = [x for x in r...
7ed2576110995a7cf9780f490fda39458ca27a3d
mattlam88/Exercises
/introduction_and_environment/data_types_and_control_flow/3_set_difference/Solution/solution.py
196
3.53125
4
# Code your solution here set_1 = "Hello World" set_2 = "Hello Universe" i = 0 result = [] while i < len(set_1): if set_1[i] in set_2: result.append(set_1[i]) i += 1 print(result)
c1df010351d6143e56de445b37040f8c517fe25f
mattlam88/Exercises
/introduction_to_python/recursive_functions/3_towers_of_hanoi/solution/solution.py
435
3.875
4
# Write your solution here def tower_of_hanoi(n , from_rod, to_rod, aux_rod): if n > 0: tower_of_hanoi(n-1, from_rod, aux_rod, to_rod) while len(from_rod) > 0: to_rod.append(from_rod.pop()) return tower_of_hanoi(n-1, to_rod,aux_rod, from_rod) # from_rod = [1,2,3] # to_...
f312013cba142059cd29777546244640a0bce75a
mattlam88/Exercises
/introduction_to_python/functions/3_count_even/Solution/solution.py
148
3.75
4
# Code your solution here def count_even(*args): count = 0 for arg in args: if arg % 2 == 0: count += 1 return count
36a61f9553627650a46a4e4bb9926d8b024bad25
mattlam88/Exercises
/introduction_to_python/classes/2_string_parenthesis/solution/solution.py
369
3.578125
4
class py_solution: def is_valid_parenthese(self, str1): brackets,container = [], {"(": ")", "{": "}", "[": "]"} for paranthese in str1: if paranthese in container: brackets.append(paranthese) elif len(brackets) == 0 or container[brackets.pop()] != paranthese: ...
a7e379e3622012cc4553e5e2b6bb6bbbe61c34a7
mattlam88/Exercises
/introduction_and_environment/data_types_and_control_flow/2_except_letter/Solution/solution.py
213
3.78125
4
# Code your solution here vowels = ['A', 'E', 'I', 'O', 'U'] string = "BYTE ACADEMY" i = 0 data = [] while i < len(string): if string[i] not in vowels: data.append(string[i]) i += 1 print(data)
88eb0d0b6478c044a168489ad11e04c99d6a1c83
AndyLee0310/108-1_Programming
/HW029.py
1,127
3.625
4
""" 29. 《孫子算經》裡有個「物不知其數」的問題:「今有物,不知其數,三三數之賸二,五五數之賸三,七七數之賸二。問物幾何? 幫你們翻譯:眼前有一堆物品,不知有多少個。每次取3個,最後剩下2個;每次取5個,最後剩下3個;每次取7個,最後剩下2個。問這堆物品到底有多少個?。 輸入說明: 每次取x1個,最後剩下y1個;每次取x2個,最後剩下y2個;每次取x3個,最後剩下y3個 輸入正整數 x1,y1,x2,y2,x3,y3 輸出說明: 這堆物品到底有多少個 Sample Input: 3 2 5 3 7 2 Sample Output: 23 """ def number(x): ...
154333e2136df4ece5479c02fc4853d24c93d21c
AndyLee0310/108-1_Programming
/HW043.py
3,030
3.59375
4
''' 043.Google搜尋器 讓我們來用程式模擬Google的搜尋器 輸入說明: 先輸入整數N,代表有N筆資訊(一串文字,包含特殊字元、空格...),接著輸入N行 資訊,再輸入使用者要的關鍵字(一行以空格隔開的關鍵字詞) 輸出說明: 根據資訊中包含幾項關鍵字的多寡進行排序,由多到少印出(若一樣,則照字典印出),並將匹配到的關鍵字全部大寫,其他保持原樣 (若拼字不完全相同,例如engineer、eng,則輸出ENGineer;大小寫不同仍視為相同,例如engINeer、NEER,則輸出engINEER)。 方便使用者找到自己想要的資料。 Sample Input: 5 National Tai...
f8ce16390e17c424df40e7612d2d166037abe398
AndyLee0310/108-1_Programming
/HW026.py
591
4.34375
4
""" 計算出最小公倍數 輸入說明: 兩個正整數 輸出說明: 這兩個正整數的最小公倍數。 Sample input: 2 3 Sample output: 6 ((維基百科,最小公倍數: https://zh.wikipedia.org/wiki/%E6%9C%80%E5%B0%8F%E5%85%AC%E5%80%8D%E6%95%B8 """ def number(x,y): if x > y : maxnum = x else: maxnum = y while(True): if ((maxn...
9bf77702fe2c812f96a6e4adbb3d3061dabfff40
AndyLee0310/108-1_Programming
/HW018.py
1,791
4.125
4
""" 請使用 while loop或for loop 第一個輸入意義為選擇三種圖形: 1 三角形方尖方面向右邊 2 三角形方尖方面向左邊 3 菱形 第二個輸入意義為畫幾行 (奇數,範圍為 3,5,7,9,....,21) input 1 (第一種圖形,三角形尖方面向右邊) 9 (共 9 行) -------------------------- output * ** *** **** ***** **** *** ** * --------------------------- input 2 (第二種圖形,三角形尖方面向左邊) 5 (共 5 行) ----------...
da58f2f89ed528b3c2f446d20b52771d30ac630c
KKHim/Survey
/Testing/Survey_sample.py
1,779
4
4
def colorsurvey(): colors = ["red", "green", "blue", "purple"] # List of color like = [] # Empty list for like dislike = [] # Empty list for dislike for i in range(len(colors)): # For loop in colors list while True: try: a = input("Do you like " + colors[...
8db5359120b3d2ad5a655c5a1273a3b029a02977
WuxinrongY/pytorch
/Ch1_张量/4_与张量相关的函数.py
703
3.796875
4
import torch """ 获取维度的数目 torch.ndimension() 获取该张量的总的元素数目 torch.nelement() 获取张量的大小 torch.size() 获取张量维度0的大小 torch.size(0) 变更张量形状 torch.view(3,3) 变更张量的形状,第一维度自动计算 torch.view(-1,3) 获取张量的数据指针 torch.data_ptr() 交换两个维度的步长 torch.transpose() """ T = torch.randn(3,3) print(T.ndimension()) print(T.nelement()) print(T.size()) prin...
380f98ad5eefcedd26a6696eab883ffc6fbdc877
Spartikin/Mastermind
/code Macker.py
808
3.984375
4
code = None print("Welcome Tom Turbo, you need to create a code that consists of four pegs.") print("Eeach peg can be of the colour (R)ed, B(L)ue, (G)reen, (Y)ellow, (W)hite,") print("or (B)lack. Specify the code by specifying four characters where each") print("character indicates a colour as above. For example, WWRG ...
8ed6de40487a769302f1b29bd8bb0f820a2ef77d
kharbandaraghu/image2excel
/run.py
1,825
3.734375
4
# Necessary imports import cv2 import xlsxwriter # This function is supposed to convert RGB values to hex # On more info how we created this visit: http://psychocodes.in/без-рубрики/rgb-to-hex-conversion-and-hex-to-rgb-conversion-in-python/ def rgb2hex(r,g,b): return "#{:02x}{:02x}{:02x}".format(r,g,b) # Now we w...
db5ba83e5403216ac873896ebe8f14b16f5e1ce8
Ryodor/CFG1
/bypass_permission.py
458
3.515625
4
import os def bypass(path): """This method changes the rights of a file to 777 Args: path (string): The path of the file you want to change chmod Return: """ if os.access(path, os.R_OK) and os.access(path, os.W_OK) and os.access(path, os.X_OK): return False else: os.ch...
7157edb7684159020f6465fc24213727a1f3b723
pcrahul702/Guess-game-in-Python
/guess game.py
260
3.90625
4
n=18 for i in range(1,5): a=int(input("Enter the no \n")) if a<n : print("Number is greater than",a) elif a>n : print("Number is smaller than",a) else: print("You guess the correct number") break print(4-i,"chances left")
e798c873edeef24e94fb349685cd88ab46644c95
aniavetian/CSE163Project
/graphing_file.py
1,811
3.6875
4
""" Ani Avetian May 31, 2020 CSE 163 Section AA Description: File contains functions that answer questions 8 and 9. These questions all have to do with graphing. """ import matplotlib.pyplot as plt import seaborn as sns class Graphing: """ Graphing class contains functions that give us information abou...
53bb037951060abb2eb07727e1279ce13a5637d7
SyntaxVoid/PyFusionDIIID
/Writing/ClusteringExample.py
3,147
3.796875
4
import matplotlib.pyplot as plt import numpy as np import random ## 0. Create a Point class and some usefull functions class Point: ## A point is created by calling Point(x,y) def __init__(self, x, y): self.x = x self.y = y return def plot_self(self, axes, marker, color): ...
22763d817e60c74a0a4435631d5d256b80940b33
reihaa/BasicProgramming
/homework/derafshi-reyhaneh-610396098-Matrixth.py
1,136
3.578125
4
def matrixth_row(a,n,k): lo=0 hi=n-1 while(lo<=hi): b=lo+(hi-lo)//3 c=lo+((hi-lo)*2)//3 if(a[b][0]<=k<=a[b][-1]) : if b==0: return a[b],b elif k==a[b-1][-1]: hi=-1 else: return a[b],b elif (a[c][0]<=k<a[c+1][0]): if b==0: return a[c],c elif k==a[c-1][-1]: hi=-1 else: ...
91664b14d1dca27793eeccd748cdcfb5b542db56
reihaa/BasicProgramming
/homework/derafshi-reyhaneh-610396098-octReverse.py
110
4.125
4
def oct(a) : while a>=8 : b=a%8 a=int(a/8) print(b) print(a) n=int(input("enter an enteger:")) oct(n)
5916b87920233a60c8e873bce99e3ab8f732076f
reihaa/BasicProgramming
/homework/derafshi-reyhaneh-610396098-printHex.py
199
3.53125
4
def printHex(a) : c="" for i in range(0,len(a),4) : b=0 v=1 for j in range(3,-1,-1): b+=v*a[i+j] v*=2 c+=str(b) print(int(c)) a=list(map(int,input().strip(" ").split())) printHex(a)
5eaebabf71d353ae3bfc84c38b3e6fcc1602e388
ciurezbogdan/thema
/main.py
794
3.703125
4
list_1 = [7, 8, 9, 2, 3, 1, 4, 10, 5, 6] list_asc = [] list_desc = [] list_par = [] list_impar = [] list_m3 = [] l_par = [] l_impar = [] l_m3 = [] print('Lista originala: ', list_1) list_asc = list(list_1) list_asc.sort() print('Lista ascendenta:', list_asc) list_desc = list(list_asc) list_desc.reverse() print('Lista ...
a59353b92c7c70c54f0521ee569be45706c14252
Yuukika/data_structure
/isomorphic_tree.py
805
3.796875
4
#!/usr/bin/env python # -*-coding:utf-8-*- class TreeNode: def __init__(self,data): self.data = data self.left = None self.right = None class Tree: def __init__(self,maxsize): self.treelist = [-1 for i in range(maxsize)] def buildtree(): maxsize = eval(input("请输入结点数:")) ...
86351044c5e3482d8f9bebe3642b214755fb9fce
GMwang550146647/network
/python基本语法/1.基本方法/1.3.模块和包/module.py
670
3.75
4
gm="gmwang" def func(gm): print(gm,"是个帅哥") class A(): def __init__(self,name,age): self.name=name self.age=age def __repr__(self): return "name:%s,age:%d"%(self.name,self.age) '''1.执行谁,谁就是__main__,当被import的时候不会被执行''' if __name__=="__main__": print("main里面") a=A("gm",10) ...
dbd53603cd19286e85d90ebb567af04f6867bef0
GMwang550146647/network
/0.leetcode/3.刷题/1.数据结构系列/1.线性结构/2.链表/23.hard_合并K个升序链表.py
2,416
3.625
4
from fundamentals.test_time import test_time from fundamentals.link_list import LinkList, ListNode from functools import reduce from heapq import * class Solution(): def __init__(self): pass @test_time def mergeKLists(self, lists): """ 不停地归并排序 """ def combine_two...
463357dbaa66440cd1c3d734565c16855a4e889c
GMwang550146647/network
/0.python_higher/1.面对对象/2.继承/2.拓展内置类.py
1,470
3.8125
4
''' 1.拓展list ''' class ContactList(list): def search(self, name): matching_contact = [] for contact in self: if name in contact.name: matching_contact.append(contact) return matching_contact ''' 2.拓展dict ''' class LongNameDict(dict): def __init__(self, *...
d1e4b538fcd866f331b860b8e3c4cda0862f0c23
GMwang550146647/network
/0.leetcode/3.刷题/2.算法系列/2.搜索/2.BFS/111.easy_二叉树最小深度(core).py
1,416
3.671875
4
from fundamentals.tree import TreeNode, Tree import time class Solution(): def __init__(self): pass '''我的方法''' max_route = -1000 def minDepth(self, root): def level_traversal(root): queue = [root] steps=1 while len(queue) != 0: for...
aa0b90c2b7916709c086986568e6e15f4aac7f64
GMwang550146647/network
/0.leetcode/0.基本数据结构/2.树形结构/1.二叉查找树/1.1.二叉树:嵌套列表实现.py
701
3.890625
4
''' 节点定义:[root,left,right] ''' class BinaryTree(): def __init__(self,obj=None): self.tree=[obj,[],[]] def insertLeft(self,root,newBranch): t=root.pop(1) if len(t)>1: root.insert([newBranch,t,[]]) else: root.insert([newBranch,[],[]]) def insertRight(sel...
848eb88a25d2268d47154ea49f06f2e889882fbc
GMwang550146647/network
/0.leetcode/0.基本数据结构/3.堆/1.二叉堆/tt.py
1,779
3.609375
4
# -*- coding:utf-8 -*- class Heap(): def __init__(self, arr): self.arr = [0] self.size = 0 for numi in arr: self.push(numi) def up(self, i): while i // 2 > 0: if self.arr[i // 2] > self.arr[i]: self.arr[i // 2], self.arr[i] = self.arr[i], ...
01eeb61269c948b318643d4f3039ff6271b85e26
GMwang550146647/network
/0.leetcode/0.基本数据结构/4.散列/3.3.散列函数设计:非数项.py
447
3.75
4
''' 1.普通方法:把字母转换成数值再运算 ''' def hash(astring,tablesize): sum=0 for pos in range(len(astring)): sum+=ord(astring[pos]) return sum%tablesize ''' 2.强化方法:为了保证字母一样时,但是位置不一样的情况的区别,加上位置权重 ''' def hashR(astring,tablesize): sum=0 for pos in range(len(astring)): sum+=ord(astring[pos])*(pos+1)...
ff6d8081f4caf701505a1b1acae652ed13463bd5
GMwang550146647/network
/0.leetcode/3.刷题/1.数据结构系列/1.线性结构/2.链表/328.mid_奇偶链表.py
1,676
3.8125
4
from fundamentals.test_time import test_time from fundamentals.link_list import LinkList, ListNode class Solution(): def __init__(self): pass @test_time def oddEvenList(self, head): ''' 把值交换 ''' even_vals = [] fast = slow = head i = 1 while ...
68b6e2a9beeae4633fdc183fbad00d73316bc5c0
GMwang550146647/network
/0.leetcode/0.基本的算法/1.递归/6.尾递归.py
1,800
3.90625
4
''' warning:由于python不支持尾递归,所以尾递归反而会慢会栈溢出 定义与区别: 非尾递归,下一个函数结束以后此函数还有后续,所以必须保存本身的环境以供处理返回值。 尾递归,进入下一个函数不再需要上一个函数的环境了,得出结果以后直接返回。 ''' '''1.普通递归,需要保护现场''' def factDG(n): if n==0 or n==1: return 1 else: return n*factDG(n-1) '''2.尾递归,不需要保护现场,只管返回就行''' def factWDG(n,temptfn=1): if n==0 or n==1: ...
24ee9f236c2a9533fc45563944b3580da273e909
GMwang550146647/network
/0.leetcode/1.LeetCodeProblems/0.example/28.sim_实现strSTR.py
964
3.796875
4
""" 实现 strStr() 函数。 给定一个 haystack 字符串和一个 needle 字符串,在 haystack 字符串中找出 needle 字符串出现的第一个位置 (从0开始)。如果不存在,则返回  -1。 示例 1: 输入: haystack = "hello", needle = "ll" 输出: 2 示例 2: 输入: haystack = "aaaaa", needle = "bba" 输出: -1 """ import time class Solution(): def __init__(self): pass '''我的方法''' def myFun(s...
b4b8f67692214e6909e2c9f74f2683f8784afd3f
GMwang550146647/network
/0.leetcode/3.刷题/1.数据结构系列/1.线性结构/3.栈/1.单调栈/1.下一个更大元素/max_stack_cmp.py
3,867
3.734375
4
from fundamentals.test_time import test_time import logging import numpy as np ''' 嘘~别说话,运行看输出就好~ ''' class ListNode(): def __init__(self, val): self.val = val self.next = None class Stack(): def __init__(self): self.head = None def pop(self): if self.head is None: ...
e57a1246ce35b0a2bad2cd2002c18995ddd7d640
GMwang550146647/network
/0.leetcode/0.基本数据结构/4.散列/4.2.解决散列冲突:数据项链chaining.py
947
4.125
4
#例如python的字典结构 ''' 1.解决冲突hash函数实现示例): 问题:在数列【26,77,93,17,31,54】数列中查找是否存在某个数 解决:利用hashfunc= num%11的方法把数放在十一个槽中,每个槽都是一个数组 ''' class hashTable: def __init__(self,arr,volumn=11): self.hashTable=[[] for i in range(11)] self.volumn=volumn self.initHashtable() print(self.hashTable...
2f809d89014869e099ffe2f58cb0373f976e6e97
GMwang550146647/network
/0.leetcode/1.LeetCodeProblems/0.example/未记录/17.RemoveDuplicatesFromSortedLinkList.py
1,069
3.75
4
''' Given a sorted linked list, delete all duplicates such that each element appear only once . Example 1: Input: 1->1->2 Output: 1->2 Example 2: Input: 1->1->2->3->3 Output: 1->2->3 ''' import time class ListNode(object): def __init__(self,x): self.val=x self.next=None class Solution(): de...
b9b0c73bea6c0f87fed365e0c69d92cd00bed9c2
GMwang550146647/network
/0.leetcode/3.刷题/2.算法系列/3.回溯/1.子集/78.mid_子集(core)(数字不重复).py
1,696
3.6875
4
from fundamentals.test_time import test_time class Solution(): def __init__(self): pass @test_time def subsets(self, nums): """ 循环解决问题: 迭代:(每一次都是在前面的情况下 + 下一个元素)+前面的情况 """ sets = [[]] for i in range(len(nums)): new_set = [item + [num...
4900a2b4744344720a2eac6e2c4614fe1aca503f
GMwang550146647/network
/0.leetcode/3.刷题/1.数据结构系列/1.线性结构/1.数组/二维数组/48.mid_旋转图像.py
694
3.546875
4
from fundamentals.test_time import test_time class Solution(): def __init__(self): pass @test_time def rotate(self, matrix): base = len(matrix) - 1 for i in range(len(matrix) // 2): for j in range(i, len(matrix) - 1 - i): matrix[i][j], matrix[base - j][...