#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
import requests#Output:
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())
'Do you have a sunburn, or are you always this hot? 🔥😏'
# Random flirt msg
😁2
Check either string is an
Anagram or not?
#Output : True
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