>>> hours = 11
>>> seconds = 5
>>> print (str(hours)+':'+str(seconds))
11:5
>>>
>>> hours = 11
>>> seconds = 5
>>> print (str(hours).rjust(2,'0')+':'+str(seconds).rjust(2,'0'))
11:05
>>>
>>> my_list = [1, 7, 11, 8, 13, 2]
>>> [("odd","even")[i % 2 == 0] for i in my_list]
['odd', 'odd', 'odd', 'even', 'odd', 'even']
>>> bases = ['U', 'C', 'A', 'G']
>>> codons = [a+b+c for a in bases for b in bases for c in bases]
>>> codons
['UUU', 'UUC', 'UUA', 'UUG', 'UCU', 'UCC', 'UCA', 'UCG', 'UAU', 'UAC', 'UAA', 'UAG', 'UGU', 'UGC', 'UGA', 'UGG', 'CUU', 'CUC', 'CUA', 'CUG', 'CCU', 'CCC', 'CCA', 'CCG', 'CAU', 'CAC', 'CAA', 'CAG', 'CGU', 'CGC', 'CGA', 'CGG', 'AUU', 'AUC', 'AUA', 'AUG', 'ACU', 'ACC', 'ACA', 'ACG', 'AAU', 'AAC', 'AAA', 'AAG', 'AGU', 'AGC', 'AGA', 'AGG', 'GUU', 'GUC', 'GUA', 'GUG', 'GCU', 'GCC', 'GCA', 'GCG', 'GAU', 'GAC', 'GAA', 'GAG', 'GGU', 'GGC', 'GGA', 'GGG']
import re
reg = r"([\w\.-]+)(@)([\w\.-]+)(\.[\w\.]+)"
jumla = "Please contact info-ur@wikimedia.org for assistance. Please contact info-ur@wikimedia.org for assistance. Please contact info-ur@wikimedia.org for assistance"
natija = re.findall(reg, jumla)
if natija:
tup = natija
a,*b = tup
for i in tup:
print(''.join(i))
درست فرمایا۔
یوں:
import re
reg = r"([\w\.-]+)(@)([\w\.-]+)(\.[\w\.]+)"
jumla = "Please contact info-ur@wikimedia.org for assistance. Please contact info-ur@wikimedia.org for assistance. Please contact info-ur@wikimedia.org for assistance"
natija = re.findall(reg, jumla)
if natija:
for i in natija:
print(''.join(i))
یوں:
PHP:import re reg = r"([\w\.-]+)(@)([\w\.-]+)(\.[\w\.]+)" jumla = "Please contact info-ur@wikimedia.org for assistance. Please contact info-ur@wikimedia.org for assistance. Please contact info-ur@wikimedia.org for assistance" natija = re.findall(reg, jumla) if natija: for i in natija: print(''.join(i))