Hacker Rank Python
Hacker Rank Python
if __name__ == '__main__':
a = int(input())
b = int(input())
sumn = lambda a,b : a+b
print(sumn(a,b))
diff = lambda a,b : a-b
print(diff(a,b))
prod = lambda a,b : a*b
print(prod(a,b))
'''The first line contains the sum of the two numbers.
The second line contains the difference of the two numbers (first -
second).
The third line contains the product of the two numbers.'''
'''Task
Read an integer . For all non-negative integers , print . See the
sample for details.'''
if __name__ == '__main__':
n = int(input())
for i in range(n):
print(i**2)
'''Task
Read two integers and print two lines. The first line should
contain integer division, // . The second line should contain
float division, / .
if __name__ == '__main__':
a = int(input())
b = int(input())
intdiv = lambda a,b : a//b
print(intdiv(a,b))
decdiv = lambda a,b : a/b
print(decdiv(a,b))
'''Read an integer N.
if __name__ == '__main__':
n = int(input())
for i in range(1,n+1):
print(i,end='')
# Enter your code here. Read input from STDIN. Print output to
STDOUT
import email.utils
print email.utils.parseaddr('DOSHI <[email protected]>')
print email.utils.formataddr(('DOSHI', '[email protected]'))
produces this output:
('DOSHI', '[email protected]')
DOSHI <[email protected]>'''
import re
pattern = r'[\s:](#[0-9a-f]{3,6})'
for i in range(int(input())):
css = input()
matches = re.findall(pattern,css,re.IGNORECASE)
for m in matches:
print(m)