0
1.How do restrict if user type same stuname..it will show an (already)2.if user enter same stuname,same age,but city is differen
1.How do restrict if user type same stuname..it will show an (already)2.how do code iff user enter same stuname,same age,but city is different.. https://code.sololearn.com/czD1Keq9J3oV/?ref=app
12 Réponses
+ 2
Rohit Murali did it work?
+ 1
Tq Steven..But I couldn't understand.. just I'm a beginner level..could u plz implement with my code
+ 1
Try this:
(put this in the mainmenu after taking input)
if any([i[0]==newname and i[1]==newage and i[2]==newcity for i in ls]):
print("repeated!")
else:
obj.add(newname,newage,newcity)
Do you wanna add if the city name is different?
+ 1
Yes..if user enter same stuname,same age,and same city(print already) but user type same stuname,same age,and if city is different..it will allows..
+ 1
Tq namit for ur time and help..
+ 1
You didn't give heed to my solution 😐
https://code.sololearn.com/cVYO21m37XG9/?ref=app
+ 1
This is exactly want..Tq soo soo much namit....all is well..I will practice and let u know Tomorrow..if I have any dbt..I can ask..
0
plz Anyone give solution
0
I believe you will benefit from matching inputs to a dictionary
https://code.sololearn.com/cmz6Yj5ZlBvA/#py
0
I want to..if user type same stuname,same age..but city wil different..if all the same..it will show (already )
0
Hi Steve tq very much for help..but I want to show error..when user type same stuname.
0
Ur implementation of code not show error..it will show same data's 2times ..I don't want..