Winter Bootcamp in ML and IoT in Jaipur
 Course content (For Bootcamp & Winter Training):- Machine Learning (ML) || Internet of Things (IoT) || Register for winter bootcamp
0 like 0 dislike
in Examples, Exercises and Projects by (3.3k points)

Vaish is very fond of series and patterns. She is creative to the core and loves to solve the series. She always brings new series for her friends to solve. Last week she was working on something   where she thought of an interesting series and now wants you to see if you can guess the series correctly or not. She is very excited about it and has decided that she will give you the first 7 terms of the series for help and the rest will have to be figured out by you.

Series: 1 1 2 2 4 2 6

1 Answer

0 like 0 dislike
by (3.3k points)
 
Best answer

a=int(input())

b=int(input())

s1=1

s2=1

for i in range(b):

    if i==0 or i==1:

        c=1

    elif i%2==0:

        c=s1+s2

        s1=s2

        s2=c

    else:

        c=s2//s1

        s1=s2

        s2=c

    print(c,end=' ')

print("")

Winter 10 Days boot-camp classes(7 HRS Daily) will start from 5, 20 & 27 December 2019 in:
1) Internet of things(IoT) Using RASPBERRY-PI
2) Machine Learning (ML)

70% OFF| Fee-INR 3,000/-

Limited seats!! Hurry up!!

[[ CALL - 07976731765 ]]

Some Study Resources are compiled from original Stack Overflow Documentation, the content is developed by the different experts at Stack Overflow. Study resources are released under Creative Commons BY-SA. Images may be copyright of their respective owners. This website is for self-learning and not affiliated with Stack Overflow. All trademarks and registered trademarks are the property of their respective company owners. Please send feedback and corrections to chandwaglobal@gmail.com.

Goeduhub Important Lists Our Youtube Channels (For free E-learning)
About Us List of IITs Goeduhub Technologies
Contact Us List of NITs AI and Big Data-HADOOP E-Learning Series
  List of PSUs Smart Learning PLC-SCADA, IoT and Raspberry-PI
  List of Exams After Graduation  
...