-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask.py
More file actions
42 lines (30 loc) · 762 Bytes
/
Copy pathtask.py
File metadata and controls
42 lines (30 loc) · 762 Bytes
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
#!/usr/bin/env python
# coding: utf-8
# # assignment requirements
# - def
# - while
# - if,else
# - if, else(nested)
# - .isdigit()
# - .isalpha()
# - print()
# - input()
# In[1]:
# program -- string digit or alpha
# number comparison greater than, is small or big
# while loop for forever loop
def str_analysis(string):
if string.isdigit():
if int(string) > 99:
print(string, "is a big number.")
else:
print(string,"is small number.")
elif string.isalpha():
print(string,"is all alphabetical characters.")
else:
print(string,"is neither all alpha nor all digit.")
value = ""
while value == "":
value = input("Enter word or integer : ")
str_analysis(value)
# In[ ]: