Read an integer $N$ (use raw_input() command
). Without using any string methods, try to print the following:
Note that "$...$" represents the values in between.
The first line contains an integer $N$.
Output the answer as explained in the task.
3
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with $1$ and $1$, the first $12$ terms will be:
$$ 1, 1, \mathbf{2}, 3, 5, \mathbf{8}, 13, 21, \mathbf{34}, 55, 89, \mathbf{144},... $$yield
the valuewrite a generator which yields a sequence of even numbers.
def fibeven(): # complete this part gen = fibeven() for i in gen: if i > 150: break else: print i
expected result would be:
2 8 34 144
By considering the terms in the Fibonacci sequence whose values do not exceed $N$, find the sum of the even-valued terms.
First line contains $T$ that denotes the number of test cases. This is followed by $T$ lines, each containing an integer, $N$.
Print the required answer for each test case.
2 10 100
10 44
A valid mobile number is a ten digit number starting with a $7$, $8$ or $9$. In another hand, people use to write phone numbers in different styles:
88889900 888-899-00 888 899000 8888 9900 8888-9900
use python's regular expression (re
) library to findall()
valid phone numbers in a given text.
a text file, all characters are supposed to be in ASCII format.
Output the answer as explained in the task.
Contact info: Phone number: 8912 2134 Fax: 8912 2100 Email: whatever@blaah.com
8912 2134 8912 2100