All the midterm questions
What is the value of the expression: 6* * 2 + 16/4 * (3 - 1) % 5
39
What is the output of this code? def tripleNum(num): ___return num * 3 n=tripleNum(5) print(tripleNum(5)+tripleNum(tripleNum(n)))
150
How many of the following can be used when creating a string Hello? 1) Hello 2)'Hello' 3) "Hello" 4)"""Hello"""
3
What is the output of this code? data = {'one' : 1, 'two': 2, 'three': 3} data['four']= 4 sum = 0 for k in data.keys(): ___if len(k) <= 3: ______sum = sum + data[k] print(sum)
3
T/F: In the latest versions of Excel, a spreadsheet with macros must be saved as a .xlsm file.
True
T/F: It is possible to GROUP BY and ORDER BY more than one column.
True
T/F: The ASCII table is a mapping from characters to bits and vice versa.
True
T/F: The command line for Mac OS generally uses the same commands as Linux
True
T/F: The format painter allows you to copy cell formatting/styles to other cells.
True
T/F: True or False
True
T/F: Worksheets and Workbooks are objects in Excel that can be manipulated with VBA code.
True
T/F: You can edit the VBA code produced after recording a macro.
True
T/F: You can put text or a value in a sparkline cell
True
T/F: a database system is the software used to manage the database (the data).
True
T/F: command line commands depend on the operating system used.
True
T/F: not (True or False) or (10 == 10)
True
Best Excel analysis tool to show different possibilities with different values for cells
What-if
What would be the best Excel analysis tool to determine if there is a relationship between two sets of values.
regression
What is the output of this code? n = 5 if n == 5: ___print("ten") elif n < 10: ___print("five") print("num")
ten num
What is the output of this code str = "Python" print(str[2:3]+str[-2])
to
What is the output of this code? str= "Python" print(str[1:2]+str[-2])
yo
The command to create a directory called 301 is:
mkdir 301
T/F: You need to write VBA code when using the record a macro feature.
False
T/F: not True and not False
False
T/F: the command-line for windows generally uses the same commands as Linux.
False
Best Excel analysis tool to determine the value of a given cell by having Excel change another cell value:
Goal seek
What is the output of this code? st1= "Hello" st2= "Bye" print(st1.upper()+st2.lower(),len(st1))
HELLObye 5
T/F: A pipe redirects the output of a command to be the input of the next command
True
T/F: A relative path to a location depends on your current location in the filed system.
True
T/F: A text file encoding is usually readable by humans.
True
T/F: A user-defined function can be used in formulas just like built-in Excel functions
True
T/F: An Excel user can control the macro settings to determine when macros are executed.
True
T/F: Ctrl+C will kill/stop the current command.
True
T/F: Data in the real, natural world is analog.
True
T/F: In excel, Formulas being with an "="
True
In Python what are the symbol(s) used for a comment?
#
T/F: The value of =CONCATENATE("Hello", "World") is "Hello World" (without quotes).
False
How many numbers are printed by this code? for i in range(1, 11): ___print(i)
10
Which one of the following is largest? 1 billion KB 1 million MB 1000 GB 1 trillion bytes 10 TB
10 TB
What is the output of this code? def tripleNum(num) ___return num*3 n= tripleNum(10) print(tripleNum(5)+tripleNum(n))
105
How many of the following variable names are valid? 1) string2 2) 4ever 3) under_Score_ 4) else 5) space space
2
Which one of the following is the largest? 2 million MB 1 TB 1500 GB 1 billion bytes 1 billion KB
2 million MB
T/F: The value of ="Hello"&"World" is "Hello World".
False
How many numbers are printed by this code? for i in range(1,9): ___if i%2 == 1: ______print(i)
4
Assume the data file mydata.txt exists and can be successfully opened. It contains 10 lines in total with each line having a number except for the fourth line which contains the word "missing". How many lines of output does this code produce? try: ___with open("mydata.txt", "r") as infile: ______for line in infile: _________print(int(line)) ___print("done") except: ___print("error") finally: ___print("finally")
5
What is the output of this code? data= {'one' : 1, 'two' : 2, 'three' : 3} data['four'] = 3 sum=0 for k in data.keys(): ___if len(k) > 3: ______sum = sum + data[k] print(sum)
6
What is the value of the expression: 2 * * 6 - 4 / 2 * (8 - 2) % 3
64
T/F: This wildcard expression be*a?.txt matches bea43.txt
False
T/F: 3B is a valid cell address in Excel.
False
T/F: A CSV file is an example of a binary file encoding.
False
T/F: A filter will not display rows that match the condition provided (ie. filter condition is true).
False
T/F: A pipe redirects the input of a command to be the input of the next command.
False
T/F: A table column can have more than one domain (data type).
False
T/F: An absolute path to a location depends on your current location in the file system.
False
T/F: Cardinality is the number of attributes in the relation.
False
T/F: Computers represent floating point values perfectly precisely.
False
T/F: Data in te real, natural world is digital.
False
T/F: If rows are sorted on two columns, the order the columns are listed in the sort does not matter.
False
T/F: In the latest versions of Excel, macros are saved with the spreadsheet in the .xlsx file.
False
T/F: Indentation does not matter in Python
False
T/F: Python 3 is backwards compatible with Python 2.
False
T/F: Python is case-insensitive
False
T/F: SQL keywords are case-sensitive
False
T/F: The cardinality of a relation is always greater than the degree of the relation
False
T/F: The difference between >> and > is that > appends to the file whereas >> will overwrite it.
False
T/F: The print command prints to standard input
False
T/F: "E" > "C"
True
T/F: (2 != 2 or 2==2) and (5 > 2 or 5 < 2)
True
T/F: A Python variable has a dynamic type (ie. can store different data types at different times)
True
T/F: A date or a time may be stored as either a number or a string.
True
T/F: A decimal value represented as a double is not perfectly precise.
True
T/F: A file encoding is how the bytes represent information/data in the file.
True
T/F: A file is a sequence of bytes on a storage device.
True
T/F: A filter will display rows that match the condition provided.
True
T/F: A macro is a recorded set of actions that can be easily executed again.
True
What is the output of this code? data=[1, 3, 4, 5] data.append(6) data.remove(1) data[3] = 6 print(data[2: 4])
[5, 6]
What s the output of this code? data = [1, 3, 4, 5] data.append(2) data.remove(1) data[1] = 6 print(data[1:3])
[6, 5]
Command to change directory to the directory above is:
cd ..
The command to delete a file called myfile.txt is:
del myfile.txt
The command to print hello on the terminal is:
echo hello
How many numbers are printed by this code? for i in range(1, 10) ___print(i)
error
What is the output of this code? n = 9 if n % 2 == 1: ___print("even") else ___print("odd")
error
What is the output of this code? st1= 10 st2= "TEST" print(st2[1:3].lower()+st2[3]+st1, len(st2))
error
What is the output of this code? n=5 if n==5: ___print("five") elif n < 10: ___print("ten") print("num")
five num