-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstr func.py
More file actions
22 lines (20 loc) · 746 Bytes
/
str func.py
File metadata and controls
22 lines (20 loc) · 746 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 28 15:59:02 2022
@author: Admin
"""
print("\n\n\n\t\t\t STRING FUNCTIONS ")
print("\t\t\t ---------------- ")
while True:
s=input("\n\t\t\t Enter the string : ")
print("\n\t\t\t 1. Length of the string : %d" %len(s))
print("\t\t\t 2. Largest ASCII Value in the string : %s" %max(s))
print("\t\t\t 3. Smallest ASCII Value in the string : %s" %min(s))
c=input("\t\t\t 4. Enter a Character : ")
k=ord(c)
print("\t\t\t ASCII Code : %d " %k)
ch=input("\t\t\t 5. Enter a Character : ")
a=(ch in s)
print("\t\t\t Is the character in string? : {0} ".format(a))
if input("\n\n\n\n\t\t\t Do you want to continue? :") != 'y':
break