0 like 0 dislike
ago in Examples, Exercises and Projects by (7k points)

Sample input: 8

Sample output: 64

1 Answer

0 like 0 dislike
ago by (7k 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)

Register fast for winter training program at Goeduhub Technologies. We are providing winter training in AI-ML, IoT, Python, Hadoop and PLC-SCADA.

[[ CALL - 07976731765 ]]

...