Activity
Aug
Sep
Oct
Nov
Dec
Jan
Feb
Mar
Apr
May
Jun
Jul
Decks by Sameer Md (3)
pythonfrom functools import reduce
num = int(input("num: "))
fib = lambda n: reduce(lambda x, _: x+[x[-1]+x[-2]],range(n-2), [0,
1])
print(fib(num))
num: 7
[0, 1, 1, 2, 3, 5, 8](0)(1)(1)
grfersgsfefrefeclass Gen<T>{
T ob;
Gen(T ob1){
ob = ob1;
}
void disp(){
System.out.println("ob = "+ob);
}
void showType()
{
System.out.println("Type of T: " + ob.getClass().getName());
}
}
public class Methods_Const_inGenerics {
public static void main(String args[]){
Gen<Double> a = new Gen<Double>(10.3);
a.disp();
a.showType();
}
}
(0)(1)(1)