Python Practical - 2 (Code)
Python Practical - 2 (Code)
2A [Code]
if x.isalpha():
alpha += 1
if x.lower() in ('a', 'e', 'i', 'o', 'u'):
vowel += 1
else:
conso += 1
elif x.isnumeric():
num += 1
else:
spchar += 1
******OUTPUT******
PS C:\Users\kambl\OneDrive\Desktop\Programs\ARK_PY> python practical_2A.py
Enter a string : Tess@120
The string 'Tess@120' contains
No. of Alphabets : 4
No. of Numeric : 3
No. of Alpha-Numeric : 7
No. of Vowel : 1
No. of Consonants : 3
No. of Special Characters : 1
Practical no. 2B [Code]
******OUTPUT******
PS C:\Users\kambl\OneDrive\Desktop\Programs\ARK_PY> python practical_2B.py
Enter first number : 6
Enter second number : 2
Addition of 6 and 2 is 8
Subtraction of 6 and 2 is 4
Multiplication of 6 and 2 is 12
Division of 6 and 2 is 3.0
Floor Division of 6 and 2 is 3
Power of 6 and 2 is 36
Modulus of 6 and 2 is 0