Untitled Document
Untitled Document
if x > y:
smaller = y
else:
smaller = x
for i in range(1, smaller+1):
if((x % i == 0) and (y % i == 0)):
hcf = i
return hcf
num1 =
num2 =
flag = False
if num == 0 or num == 1:
print(num, "is not a prime number")
elif num > 1:
if flag:
print(num, "is not a prime number")
else:
print(num, "is a prime number")
factorial = 1
if num < 0:
print("Sorry, factorial does not exist for negative
numbers")
elif num == 0:
print("The factorial of 0 is 1")
else:
for i in range(1,num + 1):
factorial = factorial*i
print("The factorial of",num,"is",factorial)
a= list[1,2,3,4,5,6,7,8,9,0]
print(a)
tuplel=(1,2,3,4,5,6,7,8,9,0)
print(tuplel)
a = [5, 2, 9, 1, 5, 6]
a.sort()
print(a)
x = np.array([1, 2, 3, 4])
y = x*2
plt.plot(x, y)
plt.show()
import numpy as np
import matplotlib.pyplot as plt
plt.xlabel("Courses offered")
plt.ylabel("No. of students enrolled")
plt.title("Students enrolled in different courses")
plt.show()
x =[5, 7, 8, 7, 2, 17, 2, 9,
4, 11, 12, 9, 6]
plt.scatter(x, y, c ="blue")
plt.show()
import turtle
t = turtle.Turtle()
r = 50
t.circle(r)
while True:
cv2.imshow("Sheep", img)
cv2.waitKey(0)
sys.exit() # to exit from all the processes
import turtle
t = turtle.Turtle()
t.forward(l)
t.left(90)
t.forward(w)
t.left(90)
t.forward(l)
t.left(90)
t.forward(w)
t.left(90)
data = np.random.randn(1000)
plt.xlabel('Values')
plt.ylabel('Frequency')
plt.title('Basic Histogram')
plt.show()