
Concept explainers
How to display the python code in tabular format.
import csv
def main():
n = int(input("Enter the number of students: "))
rows = [["First Name", "Last Name", "Ex_am 1 Grade", "Ex_am 2 Grade", "Ex_am 3 Grade", "Average"]]
for i in range(n):
first = input("\nEnter First Name of Student "+str(i+1)+": ")
last = input("Enter Last Name of Student "+str(i+1)+": ")
ex1 = int(input("Enter Ex_am 1 Grade of Student "+str(i+1)+": "))
ex2 = int(input("Enter Ex_am 2 Grade of Student "+str(i+1)+": "))
ex3 = int(input("Enter Ex_am 3 Grade of Student "+str(i+1)+": "))
avg = (ex1+ex2+ex3)/3.0
rows.append([first,last,ex1,ex2,ex3,avg])
with open("grades.csv",'w',newline = '') as _file:
file = csv.writer(_file)
for i in rows:
file.writerow(i)
print("\nWriting Done.\n")
with open("grades.csv",'r') as _file:
file = csv.reader(_file)
header = next(file)
for i in file:
i[2] = int(i[2])
i[3] = int(i[3])
i[4] = int(i[4])
i[5] = float(i[5])
print(i)
main()

To print the information in tabular format.
Step by stepSolved in 3 steps with 1 images

- Please use PYTHON def count_scrabble_points(user_input): """ The function ... """ tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 } if __name__ == "__main__": ''' Type your code here. ''' Thank you!arrow_forwardHow does the application work exactly?arrow_forwardPrompt: In Python language, write a function that applies the logistic sigmoid function to all elements of a NumPy array. Code: import numpy as np import math import matplotlib.pyplot as plt import pandas as pd def sigmoid(inputArray): modifiedArray = np.zeros(len(inputArray)) #YOUR CODE HERE: return(modifiedArray) def test(): inputs = np.arange(-100, 100, 0.5) outputs = sigmoid(inputs) plt.figure(1) plt.plot(inputs) plt.title('Input') plt.xlabel('Index') plt.ylabel('Value') plt.show() plt.figure(2) plt.plot(outputs,'Black') plt.title('Output') plt.xlabel('Index') plt.ylabel('Value') plt.show() test()arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





