 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Write a program in Python to verify kth index element is either alphabet or number in a given series
Input − Assume, you have a Series,
a abc b 123 c xyz d ijk
Solution
To solve this, we will follow the steps given below −
- Define a Series 
- Get the index from user 
- Set the if condition to check the value is digit or not. It is defined below, 
if(data[x].isdigit()):    print("digits present") else:    print("not present") Example
Let us see the following implementation to get a better understanding.
import pandas as pd dic = {'a':'abc','b':'123','c':'xyz','d':'ijk'} data = pd.Series(dic) x = input("enter the index : ") if(data[x].isdigit()):    print("digits present") else:    print("not present") Output
enter the index : a not present enter the index : b digits present
Advertisements
 