GOEDUHUB Online Courses || Last Batch Student's Projects || COVID-19 Projects(AI-ML) || Universities  ||  Placement Preparation  
+91-7976731765 Free Online Tutorials ||  MACHINE LEARNING || Python || DBMS || OOPs || DSA || Java || Linux/Unix ||  C Programming
0 like 0 dislike
56 views
in Python Programming by Goeduhub's Expert (8k points)

Sample input: 8

Sample output: 64

1 Answer

0 like 0 dislike
by Goeduhub's Expert (8k points)
 
Best answer

a=int(input())

n1=1

n2=1

for i in range(1,a+1):

    if i==1 or i==2:

        pass

      # print(n2,end=' ')

    elif i%2==0:

        n1=n1*4

      # print(n1,end=' ')

    else:

        n2=n2*3

      # print(n2,end=' ')

if a%2==0:

    print(n1)

else:

    print(n2)

Related questions

 Placements:   List of companies | Logical Reasoning Questions | Quantitative Aptitude Questions | General English Questions | Technical-MCQ and Interview Questions
 Important Lists: List of NITsList of IITsList of Exams After Graduation | List of Engineering Entrance Examinations (UG/PG)College ReviewsCollege Fest, Events & WorkshopsKnowledge ShareTrainees/Interns After 15-04-2020
Exams & Cutoffs: JEE Main | JEE Advanced | GATE | IES | ISROList of PSUs || Cutoff-GATECutoff_IIT-JEECS-ScopeECE ScopeEE-Scope
 Download Previous Year Papers For:  GATE | IES | RAJASTHAN TECHNICAL UNIVERSITY (RTU-Kota)RPSC Technical Exams | ISRO
 Goeduhub
About Us | Contact Us   Social::   |  | 
...