Malik A.

asked • 10/06/21

It should display stars, but it gives me an error

I am supposed to let the user enter number of rows and number of columns, but when I enter the rows and columns, it gives me this error

https://mrkzgulfup.com/uploads/163354717093041.jpg


and it supposed to look like this

https://mrkzgulfup.com/uploads/16335471709672.jpg


I am confused, I don't know what is wrong, but here is what the professor says about this exercise https://mrkzgulfup.com/uploads/163354717099413.jpg



here are my codes:

def filereading():

    rows = int(input("Enter the number of rows: "))

    columns = int(input("Enter the number of columns: "))

    f = open('output/data_04.txt')

    data = f.write(rowscolumns)


    print(data)


    f.close()


if __name__ == "__main__":

    filereading()


1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.