+ 1

Anyone add loops concepts in this program(logically)

need help

8th Aug 2020, 11:15 AM
Vel Murali
Vel Murali - avatar
4 odpowiedzi
+ 4
Vel Murali , yes i understand, but the implementation of loops in terms of "program logic" can be done by yourself and also be tested by yourself. Put in some temporary additional print() statements to get an idea what is happening in program flow. What you can also do is to use a web site to run your code line by line and see what the variable values are. This is a kind of debugging. http://www.pythontutor.com/visualize.html# I am sure you can solve this, and you will gain also in your problem solving ability. Happy coding!
9th Aug 2020, 11:12 AM
Lothar
Lothar - avatar
+ 3
Vel Murali , please do a try with the loop in your code by yourself first. If you are not familiar with for loop or while loop, it is recommended to work through the python tutorial. Thanks for your understanding!
8th Aug 2020, 11:26 AM
Lothar
Lothar - avatar
+ 1
# Write your code class clg: def murali(self,sub1="none",sub2="none"): sub1=int(input("enter first mark:")) sub2=int(input("enter secenod mark:")) avg=sub1+sub2 if (avg > 100): print("wrong input") elif (avg>=90 & avg>=80): print("pass") else: print("fail") obj=clg() obj.murali()
8th Aug 2020, 11:15 AM
Vel Murali
Vel Murali - avatar
+ 1
Hi Lotuar..I knew the concepts of while and for loop..But I don't know how do include the loops logically in above my program..that's why I asking anyone help..
8th Aug 2020, 11:28 AM
Vel Murali
Vel Murali - avatar