Mid Assignment CSE
Mid Assignment CSE
format(): It is used for string formatting. It replaces {0} with the value of
total.
To find the average, I divided the total by the number of inputs (which is 3 in
this case).
List can store and manage items. We can also change its elements
after they are created.
List Can store a mix of data types like integers, strings, floats, etc.
by side:
I used a for loop to repeat over each item in the students list.
I used range(0, len(students)) function to generate a sequence of
numbers starting from 0 to the length of the students list, minus one.
Then I used print function to output the indexes, which contains the
attributes ID, Name, Grade and separated them by commas.
Answer to the Question no:6
Modifying the code with left to right/right to left spacing and the .format()
function:
1.Where should we
place the input() and 1.What is the task asking
print() functions in our us to do in each
code? Where What question?