0
Given the string matric_no = "ND/20/COM/FT/500". Write a python range statement to display: i. Level ii. Year of study iii. Cour
I need a clue to solving this please
4 Answers
+ 1
if I understand correctly, that string contains all the informaion you need but you have to process it to retrieve the information you want.
so to achieve this you would need to cut the string at each '/'
info = matric_no.split("/")
now all of the information is present in a list and you can access each element with their index
print(info[0])
print(info[3])
I hope this helps :)
+ 1
level,yos,cos,mop,id = matric_no.split("/")
0
iii. Course of study
iv. Mode of programme
v. Student I.d
0
Apollo-Roboto thanks it helps. But the . split ("/") function didn't execute.. I only have a split result without (/)..