In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Nazmus Salehin -
i=0
while i<8:
user_input=input("What's your roll no?")
first_sub_score=int(input("what's your 1st sub score?"))
second_sub_score = int(input ("what's your 2nd sub score?"))
third_sub_score = int( input("what's your 3rd sub score?"))
total=float((first_sub_score+second_sub_score+third_sub_score)/3)
print(total)
i=i+1
while i<8:
user_input=input("What's your roll no?")
first_sub_score=int(input("what's your 1st sub score?"))
second_sub_score = int(input ("what's your 2nd sub score?"))
third_sub_score = int( input("what's your 3rd sub score?"))
total=float((first_sub_score+second_sub_score+third_sub_score)/3)
print(total)
i=i+1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
Md. Mazbaur Rashid
192-15-2837
192-15-2837
def avg(sub1, sub2, sub3):
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Siam Ahmed -
"""
a program to print the roll number
and average marks of 8 students in
three subjects (each out of 100)
"""
roll = [1, 2, 3, 4, 5, 6, 7, 8]
avgNumber = []
count = 0
while count < 8:
count = count + 1
subject1 = float(input("Enter the first subject mark: "))
subject2 = float(input("Enter the second subject mark: "))
subject3 = float(input("Enter the third subject mark: "))
avg = float((subject1 + subject2 + subject3) / 3.00)
avgNumber.append(avg)
i = 0
for i in range(8):
print("Roll:", roll[i])
print("Average Mark:", avgNumber[i])
i = i + 1
a program to print the roll number
and average marks of 8 students in
three subjects (each out of 100)
"""
roll = [1, 2, 3, 4, 5, 6, 7, 8]
avgNumber = []
count = 0
while count < 8:
count = count + 1
subject1 = float(input("Enter the first subject mark: "))
subject2 = float(input("Enter the second subject mark: "))
subject3 = float(input("Enter the third subject mark: "))
avg = float((subject1 + subject2 + subject3) / 3.00)
avgNumber.append(avg)
i = 0
for i in range(8):
print("Roll:", roll[i])
print("Average Mark:", avgNumber[i])
i = i + 1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
cnt = 0 ;
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
cnt = cnt + 1
print("Student Roll {} Avarage Number {}".format(cnt,avg))
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
cnt = cnt + 1
print("Student Roll {} Avarage Number {}".format(cnt,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
count = 0 ;
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Avarage Number {}".format(count,avg))
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Avarage Number {}".format(count,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Sanjina Nowshin Moon -
count = 0
while count < 8:
count = count + 1
sub1 = float(input("Enter the first subject mark: "))
sub2 = float(input("Enter the second subject mark: "))
sub3 = float(input("Enter the third subject mark: "))
avgerage = float((sub1 + sub2 + sub3) / 3.00)
avgerageNumber.append(avgerage)
i = 0
for i in range(8):
print("Roll:", roll[i])
print("Average Mark:", avgerageNumber[i])
i = i + 1
while count < 8:
count = count + 1
sub1 = float(input("Enter the first subject mark: "))
sub2 = float(input("Enter the second subject mark: "))
sub3 = float(input("Enter the third subject mark: "))
avgerage = float((sub1 + sub2 + sub3) / 3.00)
avgerageNumber.append(avgerage)
i = 0
for i in range(8):
print("Roll:", roll[i])
print("Average Mark:", avgerageNumber[i])
i = i + 1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
i=1
j=1
while i<=8:
roll=input("Roll : ")
fist=float(input("Enter first number : "))
second=float(input("Enter second number : "))
third=float(input("Enter third number : "))
avarage = float((fist+second+third)/3.00)
i = i + 1
print("Student roll :: ",roll)
print("Avarage :: ", avarage)
i=1
j=1
while i<=8:
roll=input("Roll : ")
fist=float(input("Enter first number : "))
second=float(input("Enter second number : "))
third=float(input("Enter third number : "))
avarage = float((fist+second+third)/3.00)
i = i + 1
print("Student roll :: ",roll)
print("Avarage :: ", avarage)
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Afroja Rahman -
count = 0 ;
for i in range(0 , 7):
s1 = int(input("Enter 1st Subject Mark "))
s2 = int(input("Enter 2nd Subject Mark "))
s3= int(input("Enter 3rd Subject Mark "))
sum = int(s1+s2+s3)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Average Number {}".format(count,avg))
for i in range(0 , 7):
s1 = int(input("Enter 1st Subject Mark "))
s2 = int(input("Enter 2nd Subject Mark "))
s3= int(input("Enter 3rd Subject Mark "))
sum = int(s1+s2+s3)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Average Number {}".format(count,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
i=1
j=1
while i<=8:
roll=input("Roll : ")
first=float(input("Enter first number : "))
second=float(input("Enter second number : "))
third=float(input("Enter third number : "))
avarage = float((sub1+sub2+sub3)/3.00)
i = i + 1
print("Student roll :: ",roll)
print("Avarage :: ", avarage)
j=1
while i<=8:
roll=input("Roll : ")
first=float(input("Enter first number : "))
second=float(input("Enter second number : "))
third=float(input("Enter third number : "))
avarage = float((sub1+sub2+sub3)/3.00)
i = i + 1
print("Student roll :: ",roll)
print("Avarage :: ", avarage)
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Shahid Shahriar -
count = 0 ;
for a in range(0 , 7):
x = int(input("Enter first Subject Mark "))
y = int(input("Enter second Subject Mark "))
z = int(input("Enter third Subject Mark "))
sum = int(x+y+z)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Average Number {}".format(count, avg))
for a in range(0 , 7):
x = int(input("Enter first Subject Mark "))
y = int(input("Enter second Subject Mark "))
z = int(input("Enter third Subject Mark "))
sum = int(x+y+z)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Average Number {}".format(count, avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Zafrin All Mustary -
t = 0 ;
for i in range(0 , 7):
x = int(input("Enter first subject mark "))
y = int(input("Enter second subject mark "))
z = int(input("Enter third subject mark "))
sum = int(x+y+z)
avg = float(sum / 3.00)
t = t+ 1
print("Student ID {} Avarage Marks {}".format(t,avg))
for i in range(0 , 7):
x = int(input("Enter first subject mark "))
y = int(input("Enter second subject mark "))
z = int(input("Enter third subject mark "))
sum = int(x+y+z)
avg = float(sum / 3.00)
t = t+ 1
print("Student ID {} Avarage Marks {}".format(t,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student ID: ")
subjectOne = float(input("Enter first subject's mark: "))
subjectTwo = float(input("Enter second subject's mark: "))
subjectThree = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((subjectOne+subjectTwo+subjectThree)/3))
id = input("Enter student ID: ")
subjectOne = float(input("Enter first subject's mark: "))
subjectTwo = float(input("Enter second subject's mark: "))
subjectThree = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((subjectOne+subjectTwo+subjectThree)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
def average(s1, s2, s3):
average = (s1 + s2 + s3)/3
return average
def main():
for i in range(8):
roll = input("Enter Roll Number: ")
s1 = float(input("Enter Number of First Subject: "))
s2 = float(input("Enter Number of Second Subject: "))
s3 = float(input("Enter Number of Third subject: "))
print("Student's Roll: ", roll)
print("Average Marks : %.2f" % average(s1,s2,s3))
main()
average = (s1 + s2 + s3)/3
return average
def main():
for i in range(8):
roll = input("Enter Roll Number: ")
s1 = float(input("Enter Number of First Subject: "))
s2 = float(input("Enter Number of Second Subject: "))
s3 = float(input("Enter Number of Third subject: "))
print("Student's Roll: ", roll)
print("Average Marks : %.2f" % average(s1,s2,s3))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student roll: ")
s1 = float(input("first subject mark: "))
s2 = float(input("second subject mark: "))
s3 = float(input("third subject mark: "))
print("Student Roll: ", id)
print("Average marks: "+"{:.2f}".format((s1+s2+s3)/3))
id = input("Enter student roll: ")
s1 = float(input("first subject mark: "))
s2 = float(input("second subject mark: "))
s3 = float(input("third subject mark: "))
print("Student Roll: ", id)
print("Average marks: "+"{:.2f}".format((s1+s2+s3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
def average(sub1,sub2,sub3):
average = (sub1 + sub2 + sub3) / 3
return average
def mark():
for i in range(1,8):
roll_number = input()
sub1 = float(input())
sub2 = float(input())
sub3 = float(input())
print(roll_number)
print('%.2f' % average(sub1 + sub2 + sub3))
mark()
average = (sub1 + sub2 + sub3) / 3
return average
def mark():
for i in range(1,8):
roll_number = input()
sub1 = float(input())
sub2 = float(input())
sub3 = float(input())
print(roll_number)
print('%.2f' % average(sub1 + sub2 + sub3))
mark()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Jannatul Islam -
#JANNATUL ISLAM 192-15-13064
#COLLECT DATA FROM USER AND CALCULATE AVERAGE
i=0
for i in range(0,7):
user_input=input("Enter Roll no: ")
print("Information for Roll no:"+user_input)
first_sub_marks = int(input("Enter first subject mark : "))
second_sub_marks = int(input ("Enter second subject mark : "))
third_sub_marks = int( input("Enter third subject mark : "))
average= float((first_sub_marks+second_sub_marks+third_sub_marks)/3)
print("Student roll {} Average Marks {}".format(user_input,average))
#COLLECT DATA FROM USER AND CALCULATE AVERAGE
i=0
for i in range(0,7):
user_input=input("Enter Roll no: ")
print("Information for Roll no:"+user_input)
first_sub_marks = int(input("Enter first subject mark : "))
second_sub_marks = int(input ("Enter second subject mark : "))
third_sub_marks = int( input("Enter third subject mark : "))
average= float((first_sub_marks+second_sub_marks+third_sub_marks)/3)
print("Student roll {} Average Marks {}".format(user_input,average))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
def average(x, y, z):
average = (x + y + z)/3
return average
def main():
for i in range(8):
ID = input("Enter Roll Number: ")
x = float(input("Enter Number of First Subject: "))
y = float(input("Enter Number of Second Subject: "))
z = float(input("Enter Number of Third subject: "))
print("Student's ID: ", ID)
print("Average Marks : %.2f" % average(x,y,z))
main()
average = (x + y + z)/3
return average
def main():
for i in range(8):
ID = input("Enter Roll Number: ")
x = float(input("Enter Number of First Subject: "))
y = float(input("Enter Number of Second Subject: "))
z = float(input("Enter Number of Third subject: "))
print("Student's ID: ", ID)
print("Average Marks : %.2f" % average(x,y,z))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Md. Ataur Rahman -
for i in range(8):
id = input("Enter student ID: ")
s1 = float(input("Enter first subject's mark: "))
s2 = float(input("Enter second subject's mark: "))
s3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((s1+s2+s3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
c = 0 ;
for i in range(0 , 7):
subject_1 = int(input("Enter 1st Subject Mark "))
subject_2 = int(input("Enter 2nd Subject Mark "))
subject_3= int(input("Enter 3rd Subject Mark "))
sum = int(subject_1+subject_2+subject_3)
avg = float(sum / 3.00)
c = c + 1
print("Student Roll {} Average Number {}".format(c,avg))
for i in range(0 , 7):
subject_1 = int(input("Enter 1st Subject Mark "))
subject_2 = int(input("Enter 2nd Subject Mark "))
subject_3= int(input("Enter 3rd Subject Mark "))
sum = int(subject_1+subject_2+subject_3)
avg = float(sum / 3.00)
c = c + 1
print("Student Roll {} Average Number {}".format(c,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Momotaz Zahan Mim -
for i in range(8):
id = input("Enter student ID: ")
st1 = float(input("Enter first subject's mark: "))
st2 = float(input("Enter second subject's mark: "))
st3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((st1+st2+st3)/3))
id = input("Enter student ID: ")
st1 = float(input("Enter first subject's mark: "))
st2 = float(input("Enter second subject's mark: "))
st3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((st1+st2+st3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Siam Ahamed -
cnt = 0 ;
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
cnt = cnt + 1
print("Student Roll {} Avarage Number {}".format(cnt,avg))
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
cnt = cnt + 1
print("Student Roll {} Avarage Number {}".format(cnt,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
ID = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", ID)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
ID = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", ID)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student ID: ")
subjectOne = float(input("Enter first subject's mark: "))
subjectTwo = float(input("Enter second subject's mark: "))
subjectThree = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((subjectOne+subjectTwo+subjectThree)/3))
id = input("Enter student ID: ")
subjectOne = float(input("Enter first subject's mark: "))
subjectTwo = float(input("Enter second subject's mark: "))
subjectThree = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((subjectOne+subjectTwo+subjectThree)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Mohammad Dipo Sultan -
def average(sub1, sub2, sub3):
aver=(sub1+sub2+sub3)/3.00
return aver
i=0
while i<8:
Roll=input("Enter your roll number: ")
sub1=float(input("Enter your first subject mark: "))
sub2=float(input("Enter your second subject mark: "))
sub3=float(input("Enter your third subject mark: "))
print("Roll Number: "+Roll)
print("Average Mark Out Of 100:", average(sub1,sub2,sub3))
i+=1
aver=(sub1+sub2+sub3)/3.00
return aver
i=0
while i<8:
Roll=input("Enter your roll number: ")
sub1=float(input("Enter your first subject mark: "))
sub2=float(input("Enter your second subject mark: "))
sub3=float(input("Enter your third subject mark: "))
print("Roll Number: "+Roll)
print("Average Mark Out Of 100:", average(sub1,sub2,sub3))
i+=1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
def Avg(s1, s2, s3):
Avg = (s1 + s2 + s3)/3
return Avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
s1 = float(input("Enter number of 1st subject: "))
s2 = float(input("Enter number of 2nd subject: "))
s3 = float(input("Enter number of 3rd subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % Avg(s1,s2,s3))
main()
Avg = (s1 + s2 + s3)/3
return Avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
s1 = float(input("Enter number of 1st subject: "))
s2 = float(input("Enter number of 2nd subject: "))
s3 = float(input("Enter number of 3rd subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % Avg(s1,s2,s3))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Ruhani Akter -
i=1
while i<9:
roll =int(input("Enter roll no:"))
s1 = float(input("Enter mark of 1st subject:"))
s2 = float(input("Enter mark of 2nd subject:"))
s3 = float(input("Enter mark of 3rd subject:"))
av = float((s1+s2+s3)/3)
print(roll)
print(av)
i=i+1
while i<9:
roll =int(input("Enter roll no:"))
s1 = float(input("Enter mark of 1st subject:"))
s2 = float(input("Enter mark of 2nd subject:"))
s3 = float(input("Enter mark of 3rd subject:"))
av = float((s1+s2+s3)/3)
print(roll)
print(av)
i=i+1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Md.Tawhidul Islam -
i=0
for i in range(0,7):
user_input=input("Enter Roll no: ")
print("Information for Roll no:"+user_input)
first_sub_marks = int(input("Enter first subject mark : "))
second_sub_marks = int(input ("Enter second subject mark : "))
third_sub_marks = int( input("Enter third subject mark : "))
average= float((first_sub_marks+second_sub_marks+third_sub_marks)/3)
print("Student roll {} Average Marks {}".format(user_input,average))
for i in range(0,7):
user_input=input("Enter Roll no: ")
print("Information for Roll no:"+user_input)
first_sub_marks = int(input("Enter first subject mark : "))
second_sub_marks = int(input ("Enter second subject mark : "))
third_sub_marks = int( input("Enter third subject mark : "))
average= float((first_sub_marks+second_sub_marks+third_sub_marks)/3)
print("Student roll {} Average Marks {}".format(user_input,average))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
count = 0
while count < 8:
count = count + 1
sub1 = float(input("Enter the first subject mark: "))
sub2 = float(input("Enter the second subject mark: "))
sub3 = float(input("Enter the third subject mark: "))
avgerage = float((sub1 + sub2 + sub3) / 3.00)
avgerageNumber.append(avgerage)
i = 0
for i in range(8):
print("Roll:", roll[i])
print("Average Mark:", avgerageNumber[i])
i = i + 1
while count < 8:
count = count + 1
sub1 = float(input("Enter the first subject mark: "))
sub2 = float(input("Enter the second subject mark: "))
sub3 = float(input("Enter the third subject mark: "))
avgerage = float((sub1 + sub2 + sub3) / 3.00)
avgerageNumber.append(avgerage)
i = 0
for i in range(8):
print("Roll:", roll[i])
print("Average Mark:", avgerageNumber[i])
i = i + 1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
roll number = input("Enter student roll number: ")
subject1 = float(input("Enter first subject's mark: "))
subject2 = float(input("Enter second subject's mark: "))
subject3 = float(input("Enter third subject's mark: "))
print("Student's roll number: ", id)
print("Average marks: "+"{:.2f}".format((subject1+subject2+subject3)/3))
roll number = input("Enter student roll number: ")
subject1 = float(input("Enter first subject's mark: "))
subject2 = float(input("Enter second subject's mark: "))
subject3 = float(input("Enter third subject's mark: "))
print("Student's roll number: ", id)
print("Average marks: "+"{:.2f}".format((subject1+subject2+subject3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
count = 0 ;
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Avarage Number {}".format(count,avg))
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Avarage Number {}".format(count,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by tamim rahman -
i=1
while i<=8:
roll=input("Roll : ")
fist=float(input("Enter first number : "))
second=float(input("Enter second number : "))
third=float(input("Enter third number : "))
avarage = float((fist+second+third)/3.00)
i = i + 1
print("Student roll : ",roll)
print("Avarage : ", avarage)
while i<=8:
roll=input("Roll : ")
fist=float(input("Enter first number : "))
second=float(input("Enter second number : "))
third=float(input("Enter third number : "))
avarage = float((fist+second+third)/3.00)
i = i + 1
print("Student roll : ",roll)
print("Avarage : ", avarage)
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Sujon Islam -
count = 0 ;
for i in range(0 , 7):
s1 = int(input("Enter 1st Subject Mark "))
s2 = int(input("Enter 2nd Subject Mark "))
s3= int(input("Enter 3rd Subject Mark "))
sum = int(s1+s2+s3)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Average Number {}".format(count,avg))
for i in range(0 , 7):
s1 = int(input("Enter 1st Subject Mark "))
s2 = int(input("Enter 2nd Subject Mark "))
s3= int(input("Enter 3rd Subject Mark "))
sum = int(s1+s2+s3)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Average Number {}".format(count,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
t = 0 ;
for i in range(0 , 7):
x = int(input("Enter first subject mark "))
y = int(input("Enter second subject mark "))
z = int(input("Enter third subject mark "))
sum = int(x+y+z)
avg = float(sum / 3.00)
t = t+ 1
print("Student ID {} Avarage Marks {}".format(t,avg))
for i in range(0 , 7):
x = int(input("Enter first subject mark "))
y = int(input("Enter second subject mark "))
z = int(input("Enter third subject mark "))
sum = int(x+y+z)
avg = float(sum / 3.00)
t = t+ 1
print("Student ID {} Avarage Marks {}".format(t,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Shamiul Karim Sompod -
count = 0
while count <= 7:
count = count + 1
subject1 = float(input("Enter the 1st subject mark: "))
subject2 = float(input("Enter the 2nd subject mark: "))
subject3 = float(input("Enter the 3rd subject mark: "))
avgerage = float((subject1 + subject2 + subject3) / 3.00)
avgerageNumber.append(avgerage)
i = 0
for i in range(7):
print("Roll:", roll[i])
print("Average Mark:", avgerageNumber[i])
i = i + 1
while count <= 7:
count = count + 1
subject1 = float(input("Enter the 1st subject mark: "))
subject2 = float(input("Enter the 2nd subject mark: "))
subject3 = float(input("Enter the 3rd subject mark: "))
avgerage = float((subject1 + subject2 + subject3) / 3.00)
avgerageNumber.append(avgerage)
i = 0
for i in range(7):
print("Roll:", roll[i])
print("Average Mark:", avgerageNumber[i])
i = i + 1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
cnt = 0 ;
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
cnt = cnt + 1
print("Student Roll {} Avarage Number {}".format(cnt,avg))
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
cnt = cnt + 1
print("Student Roll {} Avarage Number {}".format(cnt,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
count = 0 ;
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Avarage Number {}".format(count,avg))
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Avarage Number {}".format(count,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
roll number = input("Enter student roll number: ")
subject1 = float(input("Enter first subject's mark: "))
subject2 = float(input("Enter second subject's mark: "))
subject3 = float(input("Enter third subject's mark: "))
print("Student's roll number: ", id)
print("Average marks: "+"{:.2f}".format((subject1+subject2+subject3)/3))
roll number = input("Enter student roll number: ")
subject1 = float(input("Enter first subject's mark: "))
subject2 = float(input("Enter second subject's mark: "))
subject3 = float(input("Enter third subject's mark: "))
print("Student's roll number: ", id)
print("Average marks: "+"{:.2f}".format((subject1+subject2+subject3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
n=8
while n>0:
id = int(input("Roll number ="))
sub1 = int(input("sub1 result "))
sub2 = int(input("sub2 result "))
sub3 = int(input("sub3 result "))
avg_result = float((sub1+sub2+sub3)/3)
print("roll",id,"avg result",avg_result)
n=n-1
while n>0:
id = int(input("Roll number ="))
sub1 = int(input("sub1 result "))
sub2 = int(input("sub2 result "))
sub3 = int(input("sub3 result "))
avg_result = float((sub1+sub2+sub3)/3)
print("roll",id,"avg result",avg_result)
n=n-1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Abu Salkin -
for i in range(8):
id = input("Enter student ID: ")
subjectOne = float(input("Enter first subject's mark: "))
subjectTwo = float(input("Enter second subject's mark: "))
subjectThree = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((subjectOne+subjectTwo+subjectThree)/3))
id = input("Enter student ID: ")
subjectOne = float(input("Enter first subject's mark: "))
subjectTwo = float(input("Enter second subject's mark: "))
subjectThree = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((subjectOne+subjectTwo+subjectThree)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
def avg(sub01, sub02, sub03):
avg = (sub01 + sub02 + sub03)/3
return avg
def func():
for i in range(8):
student_roll = input("Enter roll of the student: ")
sub01 = float(input("Enter number of first subject: "))
sub02 = float(input("Enter number of second subject: "))
sub03 = float(input("Enter number of third subject: "))
print("Student's Roll: ", student_roll)
print("Average marks out of 100: %.2f" % avg(sub01,sub02,sub03))
func()
avg = (sub01 + sub02 + sub03)/3
return avg
def func():
for i in range(8):
student_roll = input("Enter roll of the student: ")
sub01 = float(input("Enter number of first subject: "))
sub02 = float(input("Enter number of second subject: "))
sub03 = float(input("Enter number of third subject: "))
print("Student's Roll: ", student_roll)
print("Average marks out of 100: %.2f" % avg(sub01,sub02,sub03))
func()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Md Sazzat Hossain -
for i in range(8):
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
ID = input("Enter student ID: ")
Subject1 = float(input("Enter Subject1 mark: "))
Subject2 = float(input("Enter Subject2 mark: "))
Subject3 = float(input("Enter Subject3 mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((st1+st2+st3)/3))
ID = input("Enter student ID: ")
Subject1 = float(input("Enter Subject1 mark: "))
Subject2 = float(input("Enter Subject2 mark: "))
Subject3 = float(input("Enter Subject3 mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((st1+st2+st3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
i=0
while i<8:
user_input=input("What's your roll no?")
first_sub_score=int(input("what's your 1st sub score?"))
second_sub_score = int(input ("what's your 2nd sub score?"))
third_sub_score = int( input("what's your 3rd sub score?"))
total=float((first_sub_score+second_sub_score+third_sub_score)/3)
print(total)
i=i+1
while i<8:
user_input=input("What's your roll no?")
first_sub_score=int(input("what's your 1st sub score?"))
second_sub_score = int(input ("what's your 2nd sub score?"))
third_sub_score = int( input("what's your 3rd sub score?"))
total=float((first_sub_score+second_sub_score+third_sub_score)/3)
print(total)
i=i+1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
count = 0 ;
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Avarage Number {}".format(count,avg))
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
count = count + 1
print("Student Roll {} Avarage Number {}".format(count,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
def avg(sub1, sub2, sub3):
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
#include
#include
main()
{
int roll_no,m1,m2,m3,total;
float average;
clrscr();
printf("Enter roll number : ");
scanf("%d",&roll_no);
printf("Enter marks 1 : ");
scanf("%d",&m1);
printf("Enter marks 2 : ");
scanf("%d",&m2);
printf("Enter marks 3 : ");
scanf("%d",&m3);
total=m1+m2+m3;
average=total/3.0;
printf("\nStudent Roll Number : %d",roll_no);
printf("\nMarks 1 : %d",m1);
printf("\nMarks 2 : %d",m2);
printf("\nMarks 3 : %d",m3);
printf("\nTotal : %d ",total);
printf("\nAverage : %f ",average);
getch();
}
#include
main()
{
int roll_no,m1,m2,m3,total;
float average;
clrscr();
printf("Enter roll number : ");
scanf("%d",&roll_no);
printf("Enter marks 1 : ");
scanf("%d",&m1);
printf("Enter marks 2 : ");
scanf("%d",&m2);
printf("Enter marks 3 : ");
scanf("%d",&m3);
total=m1+m2+m3;
average=total/3.0;
printf("\nStudent Roll Number : %d",roll_no);
printf("\nMarks 1 : %d",m1);
printf("\nMarks 2 : %d",m2);
printf("\nMarks 3 : %d",m3);
printf("\nTotal : %d ",total);
printf("\nAverage : %f ",average);
getch();
}
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
id = input("Enter student ID: ")
sub1 = float(input("Enter first subject's mark: "))
sub2 = float(input("Enter second subject's mark: "))
sub3 = float(input("Enter third subject's mark: "))
print("Student's ID: ", id)
print("Average marks: "+"{:.2f}".format((sub1+sub2+sub3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Alif Pranto -
i=0
while i<8:
user_input=input("What's your roll no?")
first_sub_score=int(input("what's your 1st sub score?"))
second_sub_score = int(input ("what's your 2nd sub score?"))
third_sub_score = int( input("what's your 3rd sub score?"))
total=float((first_sub_score+second_sub_score+third_sub_score)/3)
print(total)
i=i+1
while i<8:
user_input=input("What's your roll no?")
first_sub_score=int(input("what's your 1st sub score?"))
second_sub_score = int(input ("what's your 2nd sub score?"))
third_sub_score = int( input("what's your 3rd sub score?"))
total=float((first_sub_score+second_sub_score+third_sub_score)/3)
print(total)
i=i+1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Sazzad Hossain -
def avg(sub1, sub2, sub3):
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
cnt = 0 ;
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
cnt = cnt + 1
print("Student Roll {} Avarage Number {}".format(cnt,avg))
for i in range(0 , 7):
a = int(input("Enter 1st Subject Mark "))
b = int(input("Enter 2nd Subject Mark "))
c = int(input("Enter 3rd Subject Mark "))
sum = int(a+b+c)
#print(sum)
avg = float(sum / 3.00)
cnt = cnt + 1
print("Student Roll {} Avarage Number {}".format(cnt,avg))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
Name:MD Muhiminul Islam Mahim
ID:192-15-2850
Section:PC-A
def avg(sub1, sub2, sub3):
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
ID:192-15-2850
Section:PC-A
def avg(sub1, sub2, sub3):
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
Md. Mazbaur Rashid
192-15-2837
def avg(sub1, sub2, sub3):
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
192-15-2837
def avg(sub1, sub2, sub3):
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
def avg(sub01, sub02, sub03):
avg = (sub01 + sub02 + sub03)/3
return avg
def func():
for i in range(8):
student_roll = input("Enter roll of the student: ")
sub01 = float(input("Enter number of first subject: "))
sub02 = float(input("Enter number of second subject: "))
sub03 = float(input("Enter number of third subject: "))
print("Student's Roll: ", student_roll)
print("Average marks out of 100: %.2f" % avg(sub01,sub02,sub03))
func()
avg = (sub01 + sub02 + sub03)/3
return avg
def func():
for i in range(8):
student_roll = input("Enter roll of the student: ")
sub01 = float(input("Enter number of first subject: "))
sub02 = float(input("Enter number of second subject: "))
sub03 = float(input("Enter number of third subject: "))
print("Student's Roll: ", student_roll)
print("Average marks out of 100: %.2f" % avg(sub01,sub02,sub03))
func()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
for i in range(8):
roll number = input("Enter student roll number: ")
subject1 = float(input("Enter first subject's mark: "))
subject2 = float(input("Enter second subject's mark: "))
subject3 = float(input("Enter third subject's mark: "))
print("Student's roll number: ", id)
print("Average marks: "+"{:.2f}".format((subject1+subject2+subject3)/3))
roll number = input("Enter student roll number: ")
subject1 = float(input("Enter first subject's mark: "))
subject2 = float(input("Enter second subject's mark: "))
subject3 = float(input("Enter third subject's mark: "))
print("Student's roll number: ", id)
print("Average marks: "+"{:.2f}".format((subject1+subject2+subject3)/3))
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by NAZMUL HASSAN sanim -
i=0
while i<8:
user_input=input("What's your roll no?")
first_sub_score=int(input("what's your 1st sub score?"))
second_sub_score = int(input ("what's your 2nd sub score?"))
third_sub_score = int( input("what's your 3rd sub score?"))
total=float((first_sub_score+second_sub_score+third_sub_score)/3)
print(total)
i=i+1
while i<8:
user_input=input("What's your roll no?")
first_sub_score=int(input("what's your 1st sub score?"))
second_sub_score = int(input ("what's your 2nd sub score?"))
third_sub_score = int( input("what's your 3rd sub score?"))
total=float((first_sub_score+second_sub_score+third_sub_score)/3)
print(total)
i=i+1
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
def avg(sub1, sub2, sub3):
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
avg = (sub1 + sub2 + sub3)/3
return avg
def main():
for i in range(8):
Student_roll = input("Enter roll of the student: ")
sub1 = float(input("Enter number of first subject: "))
sub2 = float(input("Enter number of second subject: "))
sub3 = float(input("Enter number of third subject: "))
print("Student's Roll: ", Student_roll)
print("Average marks out of 100: %.2f" % avg(sub1,sub2,sub3))
main()
In reply to First post
Re: Write a program to print the roll number and average marks of 8 students in three subjects (each out of 100). The marks are entered by user.
by Meherol Hasan -
count = 0
while count < 8:
count = count + 1
subj1 = float(input("Enter the 1st subject mark: "))
subj2 = float(input("Enter the 2nd subject mark: "))
subj3 = float(input("Enter the 3rd subject mark: "))
avgerage = float((subj1 + subj2 + subj3) / 3.00)
avgerageNumber.append(avgerage)
i = 0
for i in range(8):
print("Roll:", roll[i])
print("Average Mark:", avgerageNumber[i])
i = i + 1
while count < 8:
count = count + 1
subj1 = float(input("Enter the 1st subject mark: "))
subj2 = float(input("Enter the 2nd subject mark: "))
subj3 = float(input("Enter the 3rd subject mark: "))
avgerage = float((subj1 + subj2 + subj3) / 3.00)
avgerageNumber.append(avgerage)
i = 0
for i in range(8):
print("Roll:", roll[i])
print("Average Mark:", avgerageNumber[i])
i = i + 1