codes
codes
1. Scatter chat
x = [2, 9, 8, 5, 6]
plt.scatter(x,y)
plt.title('Scatter Chart')
plt.xlabel('X-axis')
plt.ylabel('Y-axis')
plt.show()
2. Bar chart
import matplotlib.pyplot as py
over=[1,2,3,4]
runs=[6,8,9,7]
py.title("t20 match")
py.xlabel("over")
py.ylabel("runs")
py.bar(over,runs, color=c)
py.show()
3. Armstrong number
sum = 0
temp = num
digit = temp % 10
sum += digit ** 3
temp //= 10
if num == sum:
else:
4. Reversal
reversed_num = int(str(num)[::-1])
5. Palindrome
temp=num
rev=0
while(num>0):
digit=num%10
rev=rev*10+digit
num=num//10
if(temp==rev):
else:
6. Pyramids
print()
7. Repetitive pyramid
num = rows
print("\r")