Hello All,
Have launched a Data Science weekly magazine that would cover Data Science,
Artificial Intelligence, Machine Learning, Mathematics and other allied
subjects.
You may get the first issue here
https://datasciencenews.herokuapp.com/2018/08/19/issue-1.html
--
Karthikeyan A K
Founder of
Hi Ankur
You are getting the error because you have initialized 'std' as an empty
list: std = []
and then indexing it: std[i]. If you are not sure of the size of the list
at the time of declaration, you will have to use the list method "append()"
to add elements to the list: std.append(STUDENT(roll
I think you should be using some function to push in the data, not
referencing it with an offset address and then trying to push in.
The Python documents should give you the required information about the
same.
--
Sayantan Bhattacharya
[Sent from pine@dev-machine]
On Sun, 19 Aug 2018, ankur
Hey,
You need to use std.append(STUDENT(roll,name,present,absent))
Since you have just initialized the list named std, there is no index
available in the begining.
Thanks,
Prince
On Sun, 19 Aug 2018, 16:00 Sayantan, wrote:
> Hello Ankur,
>
> A few things before we take the program in contex
Dear Sayantan, Mohit
Tried executing by implementing following change
class STUDENT:
no_of_students=0
def __init__(self,roll,name,present,absent):
self.roll=roll
self.name=name
self.present=present
self.absent=absent
STUDENT.no_of_students+=1
std= []
n='Y'
i=0
while n=='Y' or n=='y':
roll=input("
Hello Ankur,
A few things before we take the program in context:
1. Always paste the code in a page(pastebin/paste.ubuntu.com & the like)
so that the indentation remains proper. This will help the members to
easily figure out the issue with the code.
2. Always refer to the error message prov
-- Forwarded message -
From: ankur gupta
Date: Sun, Aug 19, 2018 at 3:07 PM
Subject: Please help with this code
To:
Dear Sir
I am new to python programing, I am getting error while executing this
code. I want to generate multiple instance using while loop to store data
followin