Thursday, 7 May 2020
help & tab completion | Python
Author May 07, 2020 Python No comments
Tuesday, 5 May 2020
what are the difference between LIST , TUPLE and SET in python ?
Author May 05, 2020 Python No comments
The tuple, list, set, dictionary are trying to solve the most important problems in programming, called, storage of data and retrieval of stored data in a way that is both easy to use, to code and to read for the programmers.
The big problems are:
- space availability
- insertion
- searching by value or position
- updating
- make the operations faster for big/huge data sets
Tuple:
When you only store data that you aren't changing and don't need to do search by value as you know the position.
List:
When you store data that you changing, inserting if fast and don't need to do search/update by value as you know the position
Set:
When you store data that changes from times to time, but most importantly you need very fast search by value as you don't know position then you use sets.The search is very fast as the set is indexed in memory and fast binary search used. Inserting and deletion is slow.
Dictionary:
When you need fast search, data doesn't change often, few updates and inserts. Is just advanced set where you store a group of key and value and search by the key.
Monday, 4 May 2020
Largest Number At Least Twice of Others | Python
Author May 04, 2020 Python No comments
Ransom Note | Python
Author May 04, 2020 Python No comments
Code:
class Solution:
def canConstruct(self, ransomNote: str, magazine: str) -> bool:
g=0;
for i in ransomNote:
t=ransomNote.count(i);
s=magazine.count(i);
if(t>s):
g+=1;
if(g==0):
return True;
else:
return False;
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/piraw...
Search Insert Position | Python
Author May 04, 2020 Python No comments
Intersection of Two Arrays | Python
Author May 04, 2020 Python No comments
Code:
class Solution:
def intersection(self, nums1: List[int], nums2: List[int]) -> List[int]:
output=[];
for i in nums1:
if(i in nums2 and i not in output):
output.append(i);
return output;
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/piraw...
Jewels and Stones | Python
Author May 04, 2020 Python No comments
If Expressions in Python
Author May 04, 2020 Python No comments
if else command | Python
https://www.youtube.com/watch?v=9GJWK...
Java code used in this video:
import java.util.*;
public class Hello {
public static void main(String args[])
{
Scanner obj=new Scanner(System.in);
int x=obj.nextInt();
String s=(x%2==0)?"Even":"Odd";
System.out.println(s);
}
}
Python for beginners:
https://www.youtube.com/watch?v=egq7Z...
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/piraw...
Separate 0’s and 1’s in an array | Python
Author May 04, 2020 Python No comments
https://www.youtube.com/watch?v=egq7Z..
Code:
l=int(input());
i=0;
m=[];
zeros=0;
while(i<l):
y=int(input());
if(y==0):
zeros+=1;
m.append(y);
i+=1;
i=0;
while(i<l):
if(i<zeros):
m[i]=0;
else:
m[i]=1;
i=i+1;
print(m);
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/piraw...
Find first set bit | Python
Author May 04, 2020 Python No comments
https://www.youtube.com/watch?v=egq7Z...
Code:
t=int(input());
i=0;
while(i<t):
a=int(input());
rs=bin(a)[2:];
y=list(rs);
y.reverse();
if('1' in y):
io=y.index('1');
print(io+1);
else:
print(0);
i=i+1;
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
https://www.facebook.com/groups/piraw...
Sunday, 3 May 2020
Integer and Decimal value in C#
Irawen May 03, 2020 C# No comments
- C# Integer Datatypes
- C# Decimal Datatypes
- We can only store whole number in them
- Whole Number mean number without any decimal such as 34, 204, 35 etc
- byte
- short
- int
- long
- Byte
- sbyte can store value between -128 and 127.
- byte can store value between 0 and 255.
- short can store between -32768 and 32767.
- ushort can store between 0 and 65535.
- int can stor value between -2147483648 and 2147483647.
- uint can store value between0 and 4294967295.
- long can store value between -9223372036854775808 and 9223372036854775807.
- ulong can store value between 0 and 18446744073709551615.
- General Syntax
DataType VariableName = value;
Examples
- sbyte scoreSbyte;
- byte ageByte;
- short studentIdShort = 5;
- int studentIdInteger = 43;
- We can store decimal numbers in them
- We can also store Whole number in them
- For example , 34.5, 204.3, 35.7 etc.
- float
- double
- float salaryFloat = 101.5f;
- decimal salaryDecimal = 101.25m;
- double salaryDouble = 101.5;
Saturday, 2 May 2020
List membership Testing using in | Part 8 | Python
Author May 02, 2020 Python No comments
Problem Link: Check If N and Its Double Exist: https://leetcode.com/problems/check-i... Python for beginners: https://www.youtube.com/watch?v=egq7Z...
Prime Number of Set Bits in Binary Representation | Python
Author May 02, 2020 Python No comments
Telegram: https://t.me/clcoding_python
https://www.facebook.com/pirawenpython/
Brian Kernighan’s Algorithm | Python
Author May 02, 2020 Python No comments
Number of 1 Bits https://leetcode.com/problems/number-... Counting Bits https://leetcode.com/problems/countin... Code is given in the comment section. Python for beginners: https://www.youtube.com/watch?v=egq7Z...
Telegram: https://t.me/clcoding_python https://www.facebook.com/pirawenpython/
Last Stone Weight | Python
Author May 02, 2020 Python No comments
Python for beginners: https://www.youtube.com/watch?v=egq7Z...
Telegram: https://t.me/clcoding_python https://www.facebook.com/pirawenpython/
Move Zeroes | Python
Author May 02, 2020 Python No comments
Python for beginners: https://www.youtube.com/watch?v=egq7Z...
Telegram: https://t.me/clcoding_python https://www.facebook.com/pirawenpython/
Counting Elements | Python
Author May 02, 2020 Python No comments
class Solution: def countElements(self, arr: List[int]) -> int: output=0; for i in arr: if(i+1 in arr): output+=1; return output;
Python for beginners: https://www.youtube.com/watch?v=egq7Z..
Telegram: https://t.me/clcoding_python
Popular Posts
-
In a world increasingly shaped by data, the demand for professionals who can make sense of it has never been higher. Businesses, governmen...
-
Microsoft Power BI Data Analyst Professional Certificate What you'll learn Learn to use Power BI to connect to data sources and transf...
-
If you're learning Python or looking to level up your skills, you’re in luck! Here are 6 amazing Python books available for FREE — c...
-
Introduction Artificial intelligence is rapidly transforming industries, creating a growing demand for professionals who can design, buil...
-
Large Language Models (LLMs) such as GPT, BERT, and other transformer-based systems have transformed the field of artificial intelligence....
-
Introduction Machine learning has become one of the most important technologies driving modern data science, artificial intelligence, and ...
-
How This Modern Classic Teaches You to Think Like a Computer Scientist Programming is not just about writing code—it's about developi...
-
1️⃣ x = (5) Even though it has parentheses, this is NOT a tuple . Python treats it as just the number 5 because there is no comma . So Pyth...
-
Learn to Program and Analyze Data with Python. Develop programs to gather, clean, analyze, and visualize data. Specialization - 5 course s...
-
Explanation: 1. Creating a List nums = [1, 2, 3] Explanation: nums is a variable name. [1, 2, 3] is a list in Python. The list contains th...

