Saturday, May 11, 2024
Top On Sale Product Recommendations!;Popular electric bubble gun for children's toys 32 hole bubble machine electric bubble gun without battery bubble water;Original price: PKR 3344.30;Now price: PKR 1103.56;Click&Buy: https://s.click.aliexpress.com/e/_EzM9xxZ
Saturday, July 8, 2023
Selenium with Python: Frames
element = driver.switch_to.active_element
alert = driver.switch_to.alert driver.switch_to.default_content() driver.switch_to.frame('frame_name') driver.switch_to.frame(1) driver.switch_to.frame(driver.find_elements(By.TAG_NAME, "iframe")[0]) driver.switch_to.parent_frame() driver.switch_to.window('main')
Example:#driver.get("https://testlayers.staging.senegalsoftware.com/JobPosts/create?id=326D4402-25C1-4D7E-81DB-23DA5AF14111&step=2")driver.switch_to.frame(driver.find_element(By.XPATH, '//*[@id="cke_1_contents"]/iframe'))driver.find_element(By.TAG_NAME, "p").send_keys("Dentist")driver.switch_to.parent_frame()
Tuesday, March 15, 2022
Hacker Rank 30 day code Challenge (Inheritance and constructor in python)
Hacker Rank 30 day code Challenge (Inheritance and constructor in python)
Problem:
The parent class is Person. Make a subclass Student. The Student has attributes first name, last name, Id, Scores.
Input: First Name, Last Name, ID, Number of scores (e.g 2 or 3) , Scores
Take the average of scores and print.
(Starting Person class code and Ending code is already provided in hacker rank editor)
Monday, March 14, 2022
Hacker Rank 30 day code challenge Python
Problem:
Convert a number 'n' to its binary base 2. Find base 10 integers 0,1. Find max number of consecutive 1's.
import math
no = int(input())
arr = []
while no // 2 > 0:
remainder = no % 2
arr.append(remainder)
no = no // 2
arr.append(no)
max = []
count = 0
for i in arr:
if i == 1:
count = count + 1
max.append(count)
else:
count = 0
max.sort()
print(max[-1])
Tuesday, March 8, 2022
Hacker Rank 30 Day Challenge(Recursion-Factorial Program)
Hacker Rank 30 Day Challenge(Recursion-Factorial Program)
Problem:
For a number n entered by the user, calculate its factorial. Use recursion to calculate.
Example:
n=4
Factorial of 4 is : 4x3x2x1
Factorial of 5 is: 5x4x3x2x1
#!/bin/python3
import math
import os
import random
import re
import sys
#
# Complete the 'factorial' function below.
#
# The function is expected to return an INTEGER.
# The function accepts INTEGER n as parameter.
#
def factorial(n):
i=1
r=1
for i in range(n):
r=r*(i+1)
i=i+1
return r
n=int(input().strip())
result = factorial(n)
print(result)
Monday, March 7, 2022
Split() method in Python
Split() method:
- Splits the string into a list of words.
- You can specify a separator (e.g ' '' !)
- The default separator is whitespace.
- We can take string input from the user. Use the split method and add the input to dictionary key-value pairs.
For example:
for i in range(n):
name=input()
phoneNum=name.split()
PhoneBook[phoneNum[0]]= phoneNum[1]
Another example:
string="Hello click this link"
list=string.split()
print(list)
OUTPUT:['Hello', 'click', 'this', 'link']
Process finished with exit code 0
HackerRank 30 day challenge Python (Dictionaries)
Sunday, March 6, 2022
HackerRank 30 day code challenge Day 7
HackerRank 30 day code challenge Day 7
Problem:
Take input N this is the length of the array. Take input elements of the array of (length N). Elements are all integers. Print this array in reverse order on the same line and space separated.
import math
import os
import random
import re
import sys
n = int(input().strip())
arr=[]
arr = list(map(int, input().rstrip().split()))
i=len(arr)-1
#print(i)
while i<len(arr) and i>-1:
print(f'{arr[i]}' + " " ,end='')
i=i-1
Output:6
1 2 3 4 5 6
6 5 4 3 2 1
Process finished with exit code 0
Thursday, March 3, 2022
HackerRank 30 Day Code Challenge(Day 6)
Problem:
Taking n input strings, separate each string's odd and even indexes and print the even-odd characters in form of two space-separated strings on a single line.
n=int(input())
x=0
evenstr=""
oddstr=""
i=0
for x in range(0,n):
s=input()
evenstr = ""
oddstr = ""
for i in range(0, len(s)):
if i % 2 == 0:
evenstr = evenstr + s[i]
elif i % 2 != 0:
oddstr = oddstr + s[i]
print(evenstr +' '+ oddstr )
Monday, May 31, 2010
Meeting (Tips)
- Give Suggestions about process improvement.
- Always talk and dicuss with logics.
- Suggest alternate ways of doing things.
- Always smile.
- Keep things cool and calm, dont take things too serioulsy.
- Even if you have to say "No" say it with a smile.
Saturday, May 29, 2010
Bhalay dino baat hai..
Bhalay dino ki baat hai,
Bhali si ik shakal thi,
Bhali si us ki dosti…
Na ye kay husn-e-taam ho,
Na dekhnay main aam si,
Na ye kay wo chalay to ,
Kehkishan say rah guzar lagay,
Magar wo sath ho to phir,
Bhala bhala safar lagay
Koi bhi rut ho us ki jab,
Fiza ka rang roop thi,
Wo garmiyon ki chaoon thi,
Wo sardiyon ki dhoop thi.
Na mudatoon juda rahay
Na sath subh-o-sham ho
Na rishta-e-wafa pay zid
Na ye kay izne-aam ho
Na aisi khush libasiyan
Kay sadgii gila karay
Na itni bay-takalufi
Kay aina haya karay
Na ikhtalaf main wo rang
Kay bad-maza hon khwahishain
Na is kadar supurdgi
Kay zich karain nawazisheen
Na ashqi junon ki
Kay zindagi azab ho,
Na is kadar khatoor pan,
Kay dosti kharab ho
Kabhi to baat bhi khafi,
Kabhi sakoot bhi sukhan
Kabhi to kasht-e-zafran
Kabhi udasiyon ka ban
Suna hai….
Suna hai ik umar hai
Mu’amlat-e-Dil ki bhi
Visal-e-jan fiza to kya
Faraq-e-jan vasl ki bhi
So aik roz kya howa,
Wafa pay behaas chir gaye,
Main ishq ko amar kahon,
Wo meri zid say chir gaye
Main ishq ka aseer tha
Wo ishq ko qafas kahay,
Kay umar bhar kay saath ko
Bad-taraz hawas kahay
Shajar hajar nahi kay ham
Hamesha paba-e-gil rahain'
Na door hain kay rasiyan
Galay main mustakil rahain
Muhabaton ki vusa’teen
Hamaray dast-o-pa main hain
Bas aik dars-e-nisbateen
Sagan-e-bawafa main hain
Main koi painting nahi,
Kay aik frame main rahon,
Wohi jo maan ka meet ko
Usi kay praim mian rahon
Tumhari sooch job hi ho
Main is mizaaj ki nahi
Mujhay wafa say bair hai
Ye baat aj ki nahi
Na us ko mujh pay maan tha
Na mujh ko us pay zuam hi
Jab ehad hi koi na ho
To kya gham-e-shikistagi
So apna apna rasta
Hansi khusi dabal liya
Wo apni rah chal pari
Main apni rah chal diya
Bhali si aik shakal thi
Bhali si us ki dosti
Ab us ki yaad raat din nahi
Han magar kabhi kabhi..
Han magar kabhi kabhi..
Zindagi Say Dartay Ho (Noon Meem Rashid)
Zindagi say dartay ho?
Zindagi to tum bhi ho,
Zindagi to hum bhi hain
Zindagi say dartay ho...
Aadmi say dartay ho?
Aadmi to tum bhi ho,
Aadmi to hum bhi hain
Aadmi zubaan bhi hay,
Aadmi bayaan bhi hay,
Us say tum nahi dartay...
Harf aur ma'ani kay rishta-haaye-aahan say Aadmi hai waabasta
Aadmi kay daaman say zindagi hai waabasta,
uss say tum nahi dartay...
Unkahi say dartay ho?
Jo abhi nahi aaye us ghari say dartay ho?
uss ghari ki aamad ki agahi say dartay ho?
Pahlay bhi to guzray hain
Daur naarasaai kay,
beyri ya khudaye kay
Phir bhee ye samajhtay ho
Haich !!
arzumandi
Ya shab-e-zubaan bandi
Hay raahay khuda wandi
Tum yehi samjhtay ho..
Tum magar ye kya jaano...
Lab agar nahi hiltay,
Haath jag uthtay hain
Haath jag uthtay hain
Rah ka nishaan bankar
Noor ki zabaan bankar
Haath bol uthtay hain
Subh ki azaan bankar
Roshni say dartay ho?
Roshni tau tum bhee ho,
Roshni tau hum bhi hain
Roshni say dartay ho...?
Shahar ki faseelon par
Deev ka jo saaya thaa,
Paak hogaya aakhir
Raat ka libaadah bhi
chaak hogayaa aakhir
Khaak hogayaa aakhir...
Azhdahaam-e-insaan say fard ki nawa aye
Zaat ki sadaa aye
Rah-e-shauq main jaisay
Rah ro ka khoon lapkay
Ik nayaa junoon lapkay
Aadmi chhalak uthay
Aadmi hassay dekho,
Shehar phir basay dekho
Tum abhi say dartay ho?
Haan abhi to tum bhee ho,
Haan abhi to hum bhee hain
Tum!!! abhi say dartay ho...
-
Selenium with Python: Frames element = driver . switch_to . active_element alert = driver . switch_to . alert driver . switch_to . de...
-
Hacker Rank 30 Day Challenge(Recursion-Factorial Program) Problem: For a number n entered by the user, calculate its factorial. Use recursi...
