Created
May 6, 2016 21:06
-
-
Save jsutch/eef287d26692414b0b8fa67d83dd81a2 to your computer and use it in GitHub Desktop.
isdigit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python | |
mynewlist = ['Richardson', 4, 'Reggie Kray', 2, 'Gee', 'Monahan', "23"] | |
x = 0 | |
# mynewlist = [s for s in mylist3 if s.isdigit()] | |
all(isinstance(item, int) for item in mynewlist) | |
while x < len(mynewlist): | |
item = mynewlist[x] | |
if str(item).isdigit(): | |
# if isinstance(item, int): | |
print "Digit" , item | |
x += 1 | |
else: | |
print "String", item | |
x += 1 | |
print " data elements on a line" | |
for data in mynewlist: | |
print data, | |
print "data elements newline separated" | |
for data in mynewlist: | |
print data | |
print "Printing done" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment