CODE
CODE
import re
x = True
while x:
break
break
break
break
break
else:
print("Valid Password")
x = False
break
if x:
count = 0
for i in string:
count = count + 1
str1=input("Enter a string:")
str2=''
for i in str1:
str2=i+str2
if(str1==str2):
print("Palindrome")
else:
print("Not a palindrome")
Q4.
string=input("Enter a string:")
print(string)
char_freq={}
for i in string:
if i in char_freq:
char_freq[i]=char_freq[i]+1
else:
char_freq[i] = 1
m=0
cookies_in_pack = 0
l = maxCookies % A
if m <= l:
m=l
cookies_in_pack = A
order = len(str(num))
sum = 0
temp = num
dig = temp % 10
temp = temp//10
if (num == sum):
else:
def check(str) :
str = str.lower()
vowels = set("aeiou")
s = set({})
for a in str :
if a in vowels :
s.add(a)
else:
pass
if len(s) == len(vowels) :
print("Accepted")
else :
print("Not Accepted")
check(str)
Q3.
d=0
for k in f:
w=k.split()
for i in w:
if len(i)==4:
d+=1
else:
pass
with open(first,"r") as f:
content=f.read()
with open(second,"w") as x:
x.write(content)
print("SUCCEFULLY COPIED!!")
Q5.
with open(fName,"r") as x:
for line in x:
a,b,c=line.split(',')
b=float(b)
c=float(c)
lst = []
for i in lst:
if duplicate>1:
k = lst.index(i)
lst = [1, 1, 2, 3, 4, 4, 5, 1]
print(lst)
if lst[i] == lst[i+1]:
print(2 ,lst[i])
else:
print(1 ,lst[i])
print(1,lst[len_list-1])
Q3.
lst = []
lst1= []
lst2 = []
for i in range(l):
lst1.append(lst[i])
lst2.append(lst[i])
lst = []
final_list =[]
rotate_num= int(input("Entrer position from where you want to rotate list: ")) #take input for index
from where we have to rotate it
final_list.append(lst[i])
for i in range(rotate_num):
final_list.append(lst[i])
color_1 = []
color_2 = []
color_3 = []
k=min(len_color_1,len_color_2)
for i in range(0,k):
if(color_1[i]==color_2[i]):
print("TRUE")
break;
else:
print("FALSE")
break;
l=min(len_color_2,len_color_3)
for i in range(0,l):
if(color_2[i]==color_3[i]):
print("TRUE")
break;
else:
print("FALSE")
break;
m=min(len_color_1,len_color_3)
for i in range(0,m):
if(color_1[i]==color_3[i]):
print("TRUE")
break;
else:
print("FALSE")
break;