Posts: 69
Threads: 0
Joined: Dec 2017
Dec-22-2017, 12:25 PM
(This post was last modified: Dec-22-2017, 12:28 PM by Terafy.)
Yes you could go with
.upper()
.lower()
and the best one to suit your need is:
.capitalize()
print('WiZaRd'.lower())
print('WiZaRd'.upper())
print('WiZaRd'.captialize())
Output:
wizard
WIZARD
Wizard
When my code doesn't work I don't know why **think** and when my code works I don't know why **think**
Posts: 69
Threads: 0
Joined: Dec 2017
Dec-22-2017, 12:35 PM
(This post was last modified: Dec-22-2017, 12:35 PM by Terafy.)
def c():
found = False
jobs = input("Enter the job title: ")
#right here!
jobs = jobs.capitalize()
for b in employees:
if jobs == b[2]:
## what with the len(i) in these if-statement
if len(b)==5:
print('%-30s' % (b[4]+ ','+' '+b[3]))
found = True
if len(b)==6:
print('%-30s' % (b[5]+','+' '+b[3]+' '+b[4]))
found = True
if len(b)==7:
print('%-30s' % (b[6]+','+' '+b[3]+' '+b[4]+' '+b[5]))
found = True
if found == False:
print("There is no such job")
When my code doesn't work I don't know why **think** and when my code works I don't know why **think**
Posts: 69
Threads: 0
Joined: Dec 2017
Dec-22-2017, 12:51 PM
(This post was last modified: Dec-22-2017, 12:53 PM by Terafy.)
Yes, it a good standard practice. But the data he provided didn't have that problem so it wasn't necessary to do so.
Yes, I on board! Kind of annoyed that we did not manage to get the previous one in on time...
When my code doesn't work I don't know why **think** and when my code works I don't know why **think**