-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday1.py
61 lines (57 loc) · 1.15 KB
/
day1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#to verify user id and password with otp
user_id=input("Enter your id:")
password=int(input("Enter the password:"))
otp=int(input("Enter the otp:"))
if user_id=='Banglore':
print("User_id correct")
if password==8001:
print("correct password")
if otp==4556:
print("login successful")
else :
print("invalid otp")
else:
print("password invalid")
else:
print("insert the valid id")
#WAP to print even numbers
sum=0
i=0
while i<=10:
if i%2==0:
sum=sum+i
i=i+1
print(sum)
#to to the given number is single valued or multi valued
a=[1,2,3,4]
while i<=4:
if type(a) in (int,float,bool,complex):
print("single valued")
else:
print("multi valued")
i=i+1
#to print the length of the string
a="swapnodaya"
i=0
while i<len(a):
if i%2==0:
print(a[i])
i=i+1
print()
#to check the chara,special chara,and numbers
a="1EW22CS4@#"
num=""
alpa=""
spl=""
i=0
while i<len(a):
if '0'<=a[i]<='9':
num=num+a[i]
elif 'a'<=a[i]<='z' or 'A'<=a[i]<='Z':
alpa=alpa+a[i]
else:
spl=spl+a[i]
i=i+1
print(num)
print(alpa)
print(spl)