Python Codes Basic to Advance
2.65K subscribers
82 photos
5 videos
8 files
100 links
Python Codes Basic to Advance

All Codes
@C_Codes_pro
@CPP_Codes_pro
@Java_Codes_Pro
@nodejs_codes_pro

Discussion
@bca_mca_btech
Download Telegram
#7 enumerate()
my_list5 = ['a', 'b', 'c', 'd', 'e']
for index, value in enumerate(my_list5):
print(index, value)
#8 zip()
list3 = [21, 22, 23]
list4 = ['f', 'g', 'h']
zipped = list(zip(list3, list4))
print(zipped)
#9 append()
my_list6 = [24, 25, 26]
my_list6.append(27)
print(my_list6)
👍1
#10 extend()
another_list = [28, 29, 30]
my_list7 = [31, 32, 33]
my_list7.extend(another_list)
print(my_list7)
#11 insert()
my_list8 = [34, 35, 36, 37]
my_list8.insert(2, 38)
print(my_list8)
#12 remove()
my_list9 = [39, 40, 41, 42, 43]
my_list9.remove(41)
print(my_list9)
#13 pop()
my_list10 = [44, 45, 46]
popped_element = my_list10.pop()
print(popped_element)
print(my_list10)
#14 index()
my_list11 = [47, 48, 49, 50]
index = my_list11.index(49)
print(index)
#15 count()
my_list12 = [51, 52, 53, 54, 55, 52]
count = my_list12.count(52)
print(count)
#16 reverse()
my_list13 = [56, 57, 58, 59, 60]
my_list13.reverse()
print(my_list13)
#17 clear()
my_list14 = [61, 62, 63]
my_list14.clear()
print(my_list14)

\/original_list = [64, 65, 66]
#18 copy()
original = [3, 6, 6, 8]
new_list = original.copy()
print(new_list)
#19 sort()
my_list15 = [67, 68, 69, 70]
my_list15.sort()
print(my_list15)
👍1
#20 any()
boolean_list = [True, False, False]
result = any(boolean_list)
print(result)

# @Python_Codes_Pro
# with @IOChannel_bot 😎
# this bot is only for channels
# ask on @Logicb_Support
👍1
List functions in Python
Telegram.me/Python_Codes_Pro/249
Python Codes Basic to Advance pinned «List functions in Python Telegram.me/Python_Codes_Pro/249»
# भगवत गीता - Bhagwat Geeta summary

import urllib.request
import json
chapter = input("Enter chapter number: ")
url = "https://bhagavad-gita3.p.rapidapi.com/v2/chapters/" + chapter + "/"
headers = {
"X-RapidAPI-Key": "00172e5054mshf7fe92ad8b4a5aap1ffa03jsnff24b9e4d834",
"X-RapidAPI-Host": "bhagavad-gita3.p.rapidapi.com"
}

req = urllib.request.Request(url, headers=headers)
with urllib.request.urlopen(req) as response:
data = response.read().decode('utf-8')

out = json.loads(data)
print(f"Chapter name: {out['name']}")
print(f"Summary in Hindi: {out['chapter_summary_hindi']}")
print(f"Summary in English: {out['chapter_summary']}")
😁1
Current datetime using python of India.

Are you added coding folder? 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
3
import urllib.request
import json
input=input("enter text to generate hastag : ")
url=f"https://mukesh-api.vercel.app/hastag/{input}"
req = urllib.request.Request(url)
with urllib.request.urlopen(req) as response:
data = response.read().decode('utf-8')

out = json.loads(data)
print(out)
1