#6 Arrays in Python (virtual)
import array as arr
numbers = arr.array('i',[10,20,30])
print(numbers[0]) # gets the 1st element
print(numbers[1]) # gets the 2nd element
print(numbers[2]) # gets the 3rd element
#output
#10
#20
#30
import array as arr
numbers = arr.array('i',[10,20,30])
print(numbers[0]) # gets the 1st element
print(numbers[1]) # gets the 2nd element
print(numbers[2]) # gets the 3rd element
#output
#10
#20
#30
đ7đ1
Jiske pass Laptop nhi hai đ
Mobile best Compiler's
C Compiler Click Here
C++ Compiler Click Here
Python Compiler Click Here
Java Compiler Click Here
Sql Compiler Click Here
Universal Compilers for mobile
Replit (web or app) Click Here
Jdoodle(web or app) Click Here
Programize (web) Search web
For any help Freely Say here
Mobile best Compiler's
C Compiler Click Here
C++ Compiler Click Here
Python Compiler Click Here
Java Compiler Click Here
Sql Compiler Click Here
Universal Compilers for mobile
Replit (web or app) Click Here
Jdoodle(web or app) Click Here
Programize (web) Search web
For any help Freely Say here
đ2
Learn how to create Telegram Bot
Also clear Javascript basics
(Regular video Uploading...)
https://youtube.com/playlist?list=PLjEYzWkdEvxvar65MToPfkA1x4CeZ_bNk
Also clear Javascript basics
(Regular video Uploading...)
https://youtube.com/playlist?list=PLjEYzWkdEvxvar65MToPfkA1x4CeZ_bNk
YouTube
Node js telegram bot from mobile
node js telegram bot from mobile by ignou study center - Siddharth sharma
Now you can compile your codes by @CodeCompiler_bot
Come in @IO_Coding or @bca_group_pro for Compilation of your code
Come in @IO_Coding or @bca_group_pro for Compilation of your code
"""
Pattern:
* * * *
* * *
* *
*
*
* *
* * *
* * * *
"""
n = int(input("Enter no.: "))
for i in range(1, n):
print(" " * i , "* " * (n-i))
for i in range(1, n):
print(" " * (n - i ), "* " * i)
# @Python_Codes_Pro
Pattern:
* * * *
* * *
* *
*
*
* *
* * *
* * * *
"""
n = int(input("Enter no.: "))
for i in range(1, n):
print(" " * i , "* " * (n-i))
for i in range(1, n):
print(" " * (n - i ), "* " * i)
# @Python_Codes_Pro
đ11
Common techniques for using the set() function in Python:
1. Create a set from a list:
1. Create a set from a list:
my_list = [1, 2, 2, 3, 3, 3]
my_set = set(my_list)
2.Add an item to a set:my_set = {1, 2, 3}
my_set.add(4)
3.Remove an item from a set by its value:my_set = {1, 2, 3}
my_set.remove(3)
4.Check if an item is in a set:my_set = {1, 2, 3}
if 3 in my_set:
print("The item is in the set.")
5.Get the length of a set:my_set = {1, 2, 3}
set_length = len(my_set)
6.Loop through the items in a set:my_set = {1, 2, 3}
for item in my_set:
print(item)
7.Get the union of two sets:set1 = {1, 2, 3}
set2 = {3, 4, 5}
union_set = set1.union(set2)
8.Get the intersection of two sets:set1 = {1, 2, 3}
set2 = {3, 4, 5}
intersection_set = set1.intersection(set2)
// @python_codes_prođ4â¤1
Some function of list
fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana']
#gives_count_of_apples
fruits.count('apple')
2
fruits.count('tangerine')
0
#to_get_index_of_banana
fruits.index('banana')
3
#Find_next_banana_starting_a_position_4
fruits.index('banana', 4)
6
#to_reverse_fruits_list
fruits.reverse()
fruits
['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange']
#to_add_item_at_the_end_of_the_list
fruits.append('grape')
fruits
['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange', 'grape']
#sort_the_fruits_list
fruits.sort()
fruits
['apple', 'apple', 'banana', 'banana', 'grape', 'kiwi', 'orange', 'pear']
#to_delete_the_last_item_in_the_list
fruits.pop()
'pear'
// @python_codes_pro
fruits = ['orange', 'apple', 'pear', 'banana', 'kiwi', 'apple', 'banana']
#gives_count_of_apples
fruits.count('apple')
2
fruits.count('tangerine')
0
#to_get_index_of_banana
fruits.index('banana')
3
#Find_next_banana_starting_a_position_4
fruits.index('banana', 4)
6
#to_reverse_fruits_list
fruits.reverse()
fruits
['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange']
#to_add_item_at_the_end_of_the_list
fruits.append('grape')
fruits
['banana', 'apple', 'kiwi', 'banana', 'pear', 'apple', 'orange', 'grape']
#sort_the_fruits_list
fruits.sort()
fruits
['apple', 'apple', 'banana', 'banana', 'grape', 'kiwi', 'orange', 'pear']
#to_delete_the_last_item_in_the_list
fruits.pop()
'pear'
// @python_codes_pro
â¤1
Python Codes Basic to Advance pinned ÂĢAll Codes @C_Code5 @CPP_Coding @Python_Codes_Pro @Java_Codes_Pro @jsCode0 Discussion @bca_mca_btechÂģ
You know which languages ?
Anonymous Poll
38%
Hindi/urdu written in [English]
68%
English
17%
Tamil/telugu/Malayalam/marathi etc
1%
Chinese
4%
Others
đ2đ1
If you want any bot which will run codes in your group you can freely use @CodeCompiler_Bot
đđđđ keep studying....
đđđđ keep studying....
set1 = {1, 2, 3}
set2 = {3, 4, 5}
union_set = set1.union(set2)
print(union_set)
set2 = {3, 4, 5}
union_set = set1.union(set2)
print(union_set)
"""
Pattern:
* * * *
* * *
* *
*
*
* *
* * *
* * * *
"""
n = int(input("Enter no.: "))
for i in range(1, n):
print(" " * i , "* " * (n-i))
for i in range(1, n):
print(" " * (n - i ), "* " * i)
# @Python_Codes_Pro
Pattern:
* * * *
* * *
* *
*
*
* *
* * *
* * * *
"""
n = int(input("Enter no.: "))
for i in range(1, n):
print(" " * i , "* " * (n-i))
for i in range(1, n):
print(" " * (n - i ), "* " * i)
# @Python_Codes_Pro
# Intersection [ā¤¨ā¤žā¤Ž ⤤āĨ ⤏āĨā¤¨ā¤ž ā¤šāĨā¤ā¤ž]
set1 = {1, 2, 3}
set2 = {3, 4, 5}
intersection_set = set1.intersection(set2)
print(intersection_set)
set1 = {1, 2, 3}
set2 = {3, 4, 5}
intersection_set = set1.intersection(set2)
print(intersection_set)
# Add an item to a set:
my_set = {1, 2, 3}
my_set.add(4)
print(my_set)
my_set = {1, 2, 3}
my_set.add(4)
print(my_set)
# Arithmeitic Operations
var1 = 9 #Variable1
var2 = 3 #Variable2
#Adding
print (var1, '+', var2, '=', var1 + var2)
#Subtracting
print (var1, '-', var2, '=', var1 - var2)
#Multiplying
print (var1, 'Ã', var2, '=', var1 * var2)
#Dividing
print (var1, 'Ãˇ', var2, '=', var1 / var2)
var1 = 9 #Variable1
var2 = 3 #Variable2
#Adding
print (var1, '+', var2, '=', var1 + var2)
#Subtracting
print (var1, '-', var2, '=', var1 - var2)
#Multiplying
print (var1, 'Ã', var2, '=', var1 * var2)
#Dividing
print (var1, 'Ãˇ', var2, '=', var1 / var2)