Python Codes Basic to Advance
2.66K 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
#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
👍7👏1
import requests

base_url="https://mukesh-api.vercel.app/"

class Flirt:

'Random flirt msg'

def __init__(self):

pass

def flirt(self):

url=f"{base_url}flirt"
return requests.get(url).json()["results"][0]

H=Flirt()

print(H.flirt())
#Output:
'Do you have a sunburn, or are you always this hot? 🔥😏'


# Random flirt msg
😁2
Check either string is an
Anagram or not?

An anagram is a word or phrase that is created by rearranging the letters of another word or phrase.

def is_anagram(str1,str2):

return sorted(str1)==sorted(str2)

print(is_anagram("astronomer","moonstarer"))

#Output : True
3👍2🕊1