Skip to content

Instantly share code, notes, and snippets.

View BolinF77's full-sized avatar

jcf_77 BolinF77

View GitHub Profile
@BolinF77
BolinF77 / lambda functions.py
Created November 14, 2017 14:31
lambda functions created by jichuanfeng - https://repl.it/@jichuanfeng/lambda-functions
my_add = lambda x,y: x+y
print(my_add(6,7))
@BolinF77
BolinF77 / Find Prime number 0-200.py
Created November 14, 2017 10:49
Find Prime number 0-200 created by jichuanfeng - https://repl.it/@jichuanfeng/Find-Prime-number-0-200
from math import sqrt
j=2
while j<=100:
i=2
k=sqrt(j)
while i<=k:
if j%i==0:break
i=i+1
if i>k:
print(j,end = '')
@BolinF77
BolinF77 / Guess a random number.py
Last active November 14, 2017 11:14
Guess a random number created by jichuanfeng - https://repl.it/@jichuanfeng/Guess-a-random-number
from random import randint
x=randint(0,300)
go = 'y'
while(go=='y'):
digit = int(input('Guess a number between 0 and 300:'))
if digit == x:
print('Bingo!')
elif digit > x:
print('Too large, try again')
sd1=int(input('the first side'))
sd2=int(input('the secound side'))
if sd1==sd2:
print("the square's area is",sd1*sd2)
else:
print("the rectangle's area is",sd1*sd2)
sd1=3
sd2=3
if sd1==sd2:
print("the square's area is",sd1*sd2)