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
my_add = lambda x,y: x+y | |
print(my_add(6,7)) |
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
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 = '') |
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
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') |
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
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) |
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
sd1=3 | |
sd2=3 | |
if sd1==sd2: | |
print("the square's area is",sd1*sd2) |
NewerOlder