Python Codes Basic to Advance
الذهاب إلى القناة على Telegram
Python Codes Basic to Advance All Codes @C_Codes_pro @CPP_Codes_pro @Java_Codes_Pro @nodejs_codes_pro Discussion @bca_mca_btech
إظهار المزيد2 813
المشتركون
لا توجد بيانات24 ساعات
-47 أيام
-2430 أيام
أرشيف المشاركات
Practice js 👇👇
Index:
Loops: https://t.me/nodejs_codes_pro/120
Lists ( Array ): https://t.me/nodejs_codes_pro/123
Strings: https://t.me/nodejs_codes_pro/148
Objects: https://t.me/nodejs_codes_pro/172
Numbers: https://t.me/nodejs_codes_pro/202
Practice your codes in @io_coding
Join coding:
https://t.me/addlist/2UhsQW_cGzkxMzg1
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
Current datetime using python of India.
Are you added coding folder? 👇
https://t.me/addlist/2UhsQW_cGzkxMzg1
# भगवत गीता - 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']}")#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#19 sort()
my_list15 = [67, 68, 69, 70]
my_list15.sort()
print(my_list15)#18 copy()
original = [3, 6, 6, 8]
new_list = original.copy()
print(new_list)#17 clear()
my_list14 = [61, 62, 63]
my_list14.clear()
print(my_list14)
\/original_list = [64, 65, 66]#16 reverse()
my_list13 = [56, 57, 58, 59, 60]
my_list13.reverse()
print(my_list13)#15 count()
my_list12 = [51, 52, 53, 54, 55, 52]
count = my_list12.count(52)
print(count)#14 index()
my_list11 = [47, 48, 49, 50]
index = my_list11.index(49)
print(index)#13 pop()
my_list10 = [44, 45, 46]
popped_element = my_list10.pop()
print(popped_element)
print(my_list10)#12 remove()
my_list9 = [39, 40, 41, 42, 43]
my_list9.remove(41)
print(my_list9)#11 insert()
my_list8 = [34, 35, 36, 37]
my_list8.insert(2, 38)
print(my_list8)#10 extend()
another_list = [28, 29, 30]
my_list7 = [31, 32, 33]
my_list7.extend(another_list)
print(my_list7)#9 append()
my_list6 = [24, 25, 26]
my_list6.append(27)
print(my_list6)#8 zip()
list3 = [21, 22, 23]
list4 = ['f', 'g', 'h']
zipped = list(zip(list3, list4))
print(zipped)#7 enumerate()
my_list5 = ['a', 'b', 'c', 'd', 'e']
for index, value in enumerate(my_list5):
print(index, value)