Skip to content

Instantly share code, notes, and snippets.

View DevloperHS's full-sized avatar

Purnendu Shukla(Harsh) DevloperHS

View GitHub Profile
@DevloperHS
DevloperHS / lib.rs
Created July 28, 2022 13:08
What is the error
#![cfg_attr(not(feature = "std"), no_std)]
pub use pallet::*;
#[frame_support::pallet]
pub mod pallet {
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use frame_support::{
sp_runtime::traits::Hash,
@DevloperHS
DevloperHS / google.py
Created July 9, 2023 16:52
python code to create google logo
import turtle
#get the instance of turtle
t=turtle.Turtle()
#select color
t.color('#4285F4','#4285F4') ## RBG value of color
#change the pen size
t.pensize(5)
@DevloperHS
DevloperHS / palindrome.py
Created July 11, 2023 15:44
Python Program To Check If Given String Is A Palindrome Or Not.
# write a palindrome program in python
# string jise left-> right , right-> left read kro , dono same honge : dad , mom
# user input()
s = input()
# string reverse
rev_s = s[::-1]
@DevloperHS
DevloperHS / zip.py
Created July 13, 2023 15:03
How to use zip() in python
# zip in python
# zip function takes in multiple iterables and combines them to form a single iterable object. Let's understand its use case
# 2 iterables
a = [1,2,3]
b = ["one", "two", "three"]
# use normal - error
'''
@DevloperHS
DevloperHS / discard.py
Created July 14, 2023 16:05
Python code to remove an element form a set
# discard function
s = {1,2,3}
# s_rem = s.remove(4) - throws error
s_rem = s.discard(4) # works fine
print(s)
@DevloperHS
DevloperHS / sep.py
Last active July 18, 2023 15:33
Add a thousand separator in python
num1 = 3_000_000_00
num2 = 3_0
result = num1*num2
print(result)
@DevloperHS
DevloperHS / capitalize.py
Created July 20, 2023 14:57
Code to convert to title case
word = "welcome To minute coder"
l = word.split()
m = []
for i in l:
a = i.capitalize()
m.append(a)
print(' '.join(m))
# print(word.title())
@DevloperHS
DevloperHS / batman.py
Created July 21, 2023 15:28
batman logo using python
import turtle
#initialize method
bat = turtle.Turtle()
#size of pointer and pen
bat.turtlesize(1, 1, 1)
bat.pensize(3)
#screen info
@DevloperHS
DevloperHS / star.py
Created July 22, 2023 16:41
Create an extraordinary star pattern using python turtle
from turtle import *
import random
speed(speed ='fastest')
def draw(n, x, angle):
# loop for number of stars
for i in range(n):
@DevloperHS
DevloperHS / format.py
Created July 23, 2023 15:38
F string programs
text = "PYTHON"
print(f"{text}")
print(f"{text:#<20}")
print(f"{text:_>20}")
print(f"{text:.^20}")