Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Here's the code for tenperline.py: datalist=[] for i in range(100): datalist.append(str(i)) if(i%10==9 and i!=0): print(t.join(datalist)) print( ) datalist=[] Here's the code's output: Here's the code

image text in transcribed

Here's the code for tenperline.py:

datalist=[]

for i in range(100): datalist.append(str(i)) if(i%10==9 and i!=0): print("\t".join(datalist)) print(" ") datalist=[]

Here's the code's output:

image text in transcribed

Here's the code for randomintseq.py:

import sys import random

m,n=sys.argv[1:]

for i in range(int(n)): print(random.randint(0,int(m)-1),end=" ") print("")

Here's the code's output:

image text in transcribed

Here's the output from the command line for testing the programs:

image text in transcribed

I'm assuming randomintseq.py along with tenperline.py produce a sequence of random integers with row and column alignment. The final result isn't, though. I appreciate your coding assistance to produce the assignment's result!

Compose a filter tenperline.py that reads a sequence of integers between 0 and 99 and writes 10 integers per line, with columns aligned. Then compose a program randomintseq.py that takes two command-line arguments m and n and outputs n random integers between o and m-1. Test your programs with the command python randomintseq.py 100 200 | python tenperline.py PS D:\Users cinm\Desktop\Spring 21\CSCI 151\Assignments\Assignment 7> python tenperline.py 9 1 2 3 5 6 7 8 9 4 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 PS D:\Users cinm\Desktop\Spring 21\CSCI 151\Assignments\Assignment 7> PS D:\Users cinm\Desktop\Spring 21\CSCI 151\Assignments\Assignment 7> python randomintseq.py 200 100 110 128 61 34 167 161 67 137 117 48 113 165 184 151 87 198 29 142 162 39 59 41 35 136 76 89 28 151 41 145 55 187 64 195 163 187 105 141 172 146 139 47 163 87 167 46 11 141 28 181 74 98 145 67 180 195 178 164 146 64 100 164 107 176 39 88 127 122 50 106 43 43 172 162 66 140 124 16 60 103 48 121 32 26 176 83 176 92 5 0 23 173 56 77 4 83 193 181 23 189 PS D:\Users cinm\Desktop\Spring 21\CSCI 151\Assignments\Assignment 7> PS D:\Users cinm\Desktop\Spring 21\CSCI 151\Assignments\Assignment 7> python randomintseq.py 200 100 | python tenperline.py 3 5 6 0 1 2 4 7 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 PS D:\Users cinm\Desktop\Spring 21\CSCI 151\Assignments\Assignment 7>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions