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
| #![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, |
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
| 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) |
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
| # 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] |
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
| # 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 | |
| ''' |
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
| # discard function | |
| s = {1,2,3} | |
| # s_rem = s.remove(4) - throws error | |
| s_rem = s.discard(4) # works fine | |
| print(s) |
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
| num1 = 3_000_000_00 | |
| num2 = 3_0 | |
| result = num1*num2 | |
| print(result) |
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
| 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()) |
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
| import turtle | |
| #initialize method | |
| bat = turtle.Turtle() | |
| #size of pointer and pen | |
| bat.turtlesize(1, 1, 1) | |
| bat.pensize(3) | |
| #screen info |
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 turtle import * | |
| import random | |
| speed(speed ='fastest') | |
| def draw(n, x, angle): | |
| # loop for number of stars | |
| for i in range(n): | |
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
| text = "PYTHON" | |
| print(f"{text}") | |
| print(f"{text:#<20}") | |
| print(f"{text:_>20}") | |
| print(f"{text:.^20}") |