Complete the following steps: Add a top-level docstring and a main block. (1) Create a function....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Complete the following steps: Add a top-level docstring and a main block. (1) Create a function. The function name, argument, and return value are show in the animation below: Terminalizer eric@NeoMex ~/MEGA/OPS445/midterm/f23 $ eric@NeoMex ~/MEGA/OPS445/midterm/f23 $ python Python 3.8.2 (default, Aug 25 2022, 20:48:45) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import midterm >>> help(midterm.is_a_human) >>> midterm.is_a_human(midterm. teststr) True Please note: you do not have to add datatype annotations to your function, but your function should behave similarly to what you see here. Use the provided teststr variable to test your work so far. (2) Create a second function. Its name, argument and return value are show below (2): >>> import midterm as m >>> m.read_file('passwd') Terminalizer ['whoopsie:x:117:124: :/nonexistent:/bin/false ', 'pkhan:x: 1005:1005 ::/home/pkhan:/usr/b in/fsh ', 'gnome-initial-setup:x:127:65534::/run/gnome-initial-setup/:/bin/false ', 'm essagebus: x: 102:109 :: /nonexistent:/usr/sbin/nologin ', 'mtyler:x: 1006:1111::/home/mtyle r:/usr/bin/zsh ', 'ghalleck:x: 1001:1001: Gurney Halleck::/usr/bin/zsh ', 'gdm:x:125:133 : Gnome Display Manager: /var/lib/gdm3:/bin/false ', 'cups-browsed:x: 132:122::/nonexisten t:/usr/sbin/nologin ', 'student:x:1101:1051::/home/student:/bin/sh ', 'irc:x:39:39:irc d:/run/ircd:/usr/sbin/nologin ', 'syslog:x:103:110::/home/syslog:/usr/sbin/nologin ', 'lp:x:7:7:1p:/var/spool/lpd:/usr/sbin/nologin ', 'eric:x: 1000:1000: Eric Brauer,,,:/home /eric:/usr/bin/zsh ', 'avahi:x:114:121: Avahi mDNS daemon,,,:/run/avahi-daemon:/usr/sbin /nologin ', 'gwitcher:x: 1004:1004: Geralt Witcher,,,:/home/gwitcher:/bin/sh ', 'mpd:x:1 31:29::/var/lib/mpd:/usr/sbin/nologin ', 'daemon:x:1:1: daemon:/usr/sbin:/usr/sbin/nolog in ', 'didaho:x:1002:1002: Duncan Idaho::/bin/sh ', 'systemd-network:x:100:102: systemd Network Management,,,:/run/systemd:/usr/sbin/nologin ', 'teacher:x:1102:1102:::/usr/bin /zsh ', 'sys:x:3:3:sys:/dev:/usr/sbin/nologin ', 'mail:x:8:8:mail: /var/mail:/usr/sbin/ nologin ', 'nobody:x:65534:65534: nobody: /nonexistent:/usr/sbin/nologin ', 'man:x:6:12: man: /var/cache/man:/usr/sbin/nologin ', 'tcpdump:x: 109:118::/nonexistent:/usr/sbin/nolo gin ', 'systemd-resolve:x: 104:111:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin ' , 'hhuang:x: 1012:1012: Hong Huang,,, : /home/hhuang: /bin/sh ', 'proxy:x:13:13:proxy:/bin:/ usr/sbin/nologin ', 'sync:x:4:65534: sync: /bin:/bin/sync ', 'root:x:0:0:root: /root:/bin /bash ', 'uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin ', 'JEF:x:1103:1103::: ', 'systemd-timesync:x: 101:104:systemd Time Synchronization,,, :/run/systemd: /usr/sbin/no login ', 'backup:x:34:34:backup:/var/backups: /usr/sbin/nologin ', 'bin:x:2:2:bin:/bin: /usr/sbin/nologin ', 'news:x:9:9:news: /var/spool/news:/usr/sbin/nologin ', 'sssd:x:118 :125:SSSD system user,,,:/var/lib/sss:/usr/sbin/nologin ', 'list:x:38:38:Mailing List M anager: /var/list:/usr/sbin/nologin ', 'jklee:x: 1011:1011: Lee Jae Kwon,,,:/home/jklee: /b in/sh ', 'dnsmasq:x:112:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin '] >>> Complete the following steps: Add a top-level docstring and a main block. (1) Create a function. The function name, argument, and return value are show in the animation below: Terminalizer eric@NeoMex ~/MEGA/OPS445/midterm/f23 $ eric@NeoMex ~/MEGA/OPS445/midterm/f23 $ python Python 3.8.2 (default, Aug 25 2022, 20:48:45) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import midterm >>> help(midterm.is_a_human) >>> midterm.is_a_human(midterm. teststr) True Please note: you do not have to add datatype annotations to your function, but your function should behave similarly to what you see here. Use the provided teststr variable to test your work so far. (2) Create a second function. Its name, argument and return value are show below (2): >>> import midterm as m >>> m.read_file('passwd') Terminalizer ['whoopsie:x:117:124: :/nonexistent:/bin/false ', 'pkhan:x: 1005:1005 ::/home/pkhan:/usr/b in/fsh ', 'gnome-initial-setup:x:127:65534::/run/gnome-initial-setup/:/bin/false ', 'm essagebus: x: 102:109 :: /nonexistent:/usr/sbin/nologin ', 'mtyler:x: 1006:1111::/home/mtyle r:/usr/bin/zsh ', 'ghalleck:x: 1001:1001: Gurney Halleck::/usr/bin/zsh ', 'gdm:x:125:133 : Gnome Display Manager: /var/lib/gdm3:/bin/false ', 'cups-browsed:x: 132:122::/nonexisten t:/usr/sbin/nologin ', 'student:x:1101:1051::/home/student:/bin/sh ', 'irc:x:39:39:irc d:/run/ircd:/usr/sbin/nologin ', 'syslog:x:103:110::/home/syslog:/usr/sbin/nologin ', 'lp:x:7:7:1p:/var/spool/lpd:/usr/sbin/nologin ', 'eric:x: 1000:1000: Eric Brauer,,,:/home /eric:/usr/bin/zsh ', 'avahi:x:114:121: Avahi mDNS daemon,,,:/run/avahi-daemon:/usr/sbin /nologin ', 'gwitcher:x: 1004:1004: Geralt Witcher,,,:/home/gwitcher:/bin/sh ', 'mpd:x:1 31:29::/var/lib/mpd:/usr/sbin/nologin ', 'daemon:x:1:1: daemon:/usr/sbin:/usr/sbin/nolog in ', 'didaho:x:1002:1002: Duncan Idaho::/bin/sh ', 'systemd-network:x:100:102: systemd Network Management,,,:/run/systemd:/usr/sbin/nologin ', 'teacher:x:1102:1102:::/usr/bin /zsh ', 'sys:x:3:3:sys:/dev:/usr/sbin/nologin ', 'mail:x:8:8:mail: /var/mail:/usr/sbin/ nologin ', 'nobody:x:65534:65534: nobody: /nonexistent:/usr/sbin/nologin ', 'man:x:6:12: man: /var/cache/man:/usr/sbin/nologin ', 'tcpdump:x: 109:118::/nonexistent:/usr/sbin/nolo gin ', 'systemd-resolve:x: 104:111:systemd Resolver,,,:/run/systemd:/usr/sbin/nologin ' , 'hhuang:x: 1012:1012: Hong Huang,,, : /home/hhuang: /bin/sh ', 'proxy:x:13:13:proxy:/bin:/ usr/sbin/nologin ', 'sync:x:4:65534: sync: /bin:/bin/sync ', 'root:x:0:0:root: /root:/bin /bash ', 'uucp:x:10:10:uucp:/var/spool/uucp:/usr/sbin/nologin ', 'JEF:x:1103:1103::: ', 'systemd-timesync:x: 101:104:systemd Time Synchronization,,, :/run/systemd: /usr/sbin/no login ', 'backup:x:34:34:backup:/var/backups: /usr/sbin/nologin ', 'bin:x:2:2:bin:/bin: /usr/sbin/nologin ', 'news:x:9:9:news: /var/spool/news:/usr/sbin/nologin ', 'sssd:x:118 :125:SSSD system user,,,:/var/lib/sss:/usr/sbin/nologin ', 'list:x:38:38:Mailing List M anager: /var/list:/usr/sbin/nologin ', 'jklee:x: 1011:1011: Lee Jae Kwon,,,:/home/jklee: /b in/sh ', 'dnsmasq:x:112:65534:dnsmasq,,,:/var/lib/misc:/usr/sbin/nologin '] >>>
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
What are the three main ways in which interest groups use the courts to affect public policy? Discuss one example of a successful use of the courts by an interest group.
-
Products Green, Red, and White have unit contribution margin s of $6.50, $12, and $10, respectively, and require 2, 4, and 3 direct labor hours per unit, respectively. If demand currently is far...
-
Given that the LDAP functionality can be implemented on top of a database system, what is the need for the LDAP standard?
-
Go to the Wall Street Journal home page at www.wsj.com. Search for any firm of your choice. Find its earnings announcements. What did you learn about the company from the announcements? Also, search...
-
The handmade snuffbox industry is composed of 100 identical firms, each having short-run total costs given by STC = 0.5q2 + 10q + 5 and short-run marginal costs given by SMC = q + 10 Where q is the...
-
23. A convex mirror used for rear view on an automobile has a radius of curvature of 3m. If a bus is located at 5m from this mirror, find the position, nature and magnification of the image. 24. An...
-
You are an Examiner for the Refund Integrity Program in the GST/HST Audit Division of the Canada Revenue Agency (CRA). Using sophisticated analytical tools, you are able to identify GST/HST returns...
-
This is the demand of the ABC company's products. Month Demand (Actual) 1 65 2 58 3 62 4 78 5 65 6 42 7 45 8 52 9 68 10 54 1.1) Find the forecasting data of week 4 to 11 with 3-period moving average...
-
(a). Using the list of transactions at question A5.5 prepare a spreadsheet similar to that presented in Table5.3. (b). Show that the spreadsheet totals satisfy the accounting equation. Table 5.3...
-
A generous benefactor donates $500,000 to a state university. The donation is to be used to fund student scholarships. Determine the dollar amount of scholarships that can be given out each year...
-
An FIR filter with the transfer function \[H(z)=\left(z^{-L}-1 ight)^{N}\] with \(N\) and \(L\) integers is also a comb filter. Discuss the properties of this filter regarding its zero positions and...
-
Show that if two given networks are described by \(Y_{i}=\sum_{j=1}^{M} T_{i j} X_{j}\) and \(Y_{i}^{\prime}=\) \(\sum_{j=1}^{M} T_{i j}^{\prime} X_{j}^{\prime}\), then these networks are...
-
Think about the informative, persuasive, instructional, and collaborative presentations you have experienced as a student, an employee, a consumer, or a citizen. Select two, and compare and contrast...
-
Mr Chibanda owns a Construction company based in Kasama. His Assets Register had the following details for his assets. Date of Acquisition Asset Details Cost (K) Dep. Rate (%) Accumulated Dep Dep....
-
r = 0.18 Find the coefficients of determination and non-determination and explain the meaning of each.
-
Sally hires a maid to work in her home for $250 per month. The maid is 25 years old and not related to Sally. During 2012, the maid worked 10 months for Sally. a. What is the amount of Social...
-
Bev and Ken Hair have been married for 3 years. They live at 3567 River Street, Springfield, MO 63126. Ken is a full-time student at Southwest Missouri State University (SMSU) and Bev works as an...
-
On July 1, 2012, Ted, age 73 and single, sells his personal residence of the last 30 years for $365,000. Ted's basis in his residence is $35,000. The expenses associated with the sale of his home...
-
What is an off-by-one error?
-
Will the universality of management continue to be true in the future? Why or why not?
-
Describe what a manager does. How does the work of managers differ from that of nonmanagerial employees?
Study smarter with the SolutionInn App