Facebook
From kush, 4 Years ago, written in Plain Text.
This paste is a reply to file handling 12 from kush - go back
Embed
Viewing differences between file handling 12 and lists 8
import sys
def myFun(n):
    x=len(n)
    
a=int(input())
l=list()
v=list()
count=0
for i in range(x//2):
        if(n[i]!=n[x-i-1]):
            print("Not a Lapindrome")
            sys.exit()
    print("Lapindrome")
n=input()
myFun(n)
range(a):
    ele=int(input())
    l.append(ele)
one=l.count(1)
two=l.count(2)
three=l.count(3)
v.append(one)
v.append(two)
v.append(three)
for i in range(a):
    if(l[i]!=1 and l[i]!=2 and l[i]!=3):
        count+=1
q=max(v)
if((v.count(q))==2 or (v.count(q))==3):
    print(one)
    print(two)
    print(three)
    print(count)
    print("Trip cancelled")
elif(q==one):
    print(one)
    print(two)
    print(three)
    print(count)
    print("Madikeri")
elif(q==two):
    print(one)
    print(two)
    print(three)
    print(count)
    print("Mysore")
elif(q==three):
    print(one)
    print(two)
    print(three)
    print(count)
    print("Mangalore")

Replies to lists 8 rss

Title Name Language When
lists 10 kush text 4 Years ago.