Font size
WorksheetsFirst-Game-DSI8
Total questions: 39
Worksheet time: 23mins
Typing the command cd with no parameters will :
change directory to the desktop
nothing , because we did not specify the directory name
takes us to our home directory
takes us to the sub-directory
To make a new directory , the command that we should write is :
pwd folder
cd folder
mkdir folder
touch file1
This command will always give you the absolute path of your current location:
touch
cd
pwd
mkdir
Writing the path on the provided image to access the intro_to_git folder is done using :
Relative path
Absolute path
After executing this command:
rm file1
what will happen to file1?
file1 will be removed
file1 name will be changes to untitled
it will list files located in file1
nothing , rm is not a command
The command that makes a copy of a repository into a newly created directory, with a reference still pointing to the original repository :
git clone
git push
git add .
git status
Git is a based hosting service for Github repositories, while Github is a version control system (VCS):
True
False
In git : you can commit your changes first, and after that, you can add one or more files to the index:
True
False
By using this command you can updates a remote copy of the repository with local changes:
git push
git pull
git add .
git commit
This command will updates a local copy of the repository with remote changes :
git pull
git push
git status
git add .
What is the output of the following code snippet:
corge
qux
baz
Done.
corge
qux
baz
bar
foo
Done.
The snippet doesn’t generate any output.
corge
qux
baz
What is the output of the following code snippet:
It will print the sentence for 8 times
it will not print anything because there is no specific condition
it will initiate an infinite loop
Will stop one the variable is false.
How do you start writing a while loop in Python?
while x>4 {
while x>4 (
while x>4 :
x>4 while :
Which statement is used to stop a loop?
break
stop
return
exit
Will the print() statement on line 5 be executed in this case:
Yes
No
What will be the output of the following Python code?
2 4 6 8 10 …
2 4
2 3
error
What will be the output of the following Python code?
True
False
None
none of the mentioned
Similarities between Lists and Arrays (np.array) are:
you can choose more than one answer:
Both are used for storing data
Both are mutable
Both can be indexed and iterated through
Both can be sliced
What is the output of the following code snippet:
it will not work , we should have a two vectors with equal dimensions
[ 4, 5, 11]
[ [4], [5], [11]]
[[ 4, 5, 11], [ 5, 6, 12]]
if we try to do a summation between two vectors and one of the vector of shape [1,3] and another one of shape [3,1] we will end up with :
error because they are in different shapes
a matrix of shape [3,3]
a vector of shape [3,3]
scalar multiplication
k = [print(i) for i in my_string if i not in "aeiou"]
prints all the vowels in my_string
prints all the consonants in my_string
prints all characters of my_string that aren’t vowels
prints only on executing print(k)
my_string = "hello world"
k = [(i.upper(), len(i)) for i in my_string]
print(k)
[(‘HELLO’, 5), (‘WORLD’, 5)]
[(‘H’, 1), (‘E’, 1), (‘L’, 1), (‘L’, 1), (‘O’, 1), (‘ ‘, 1), (‘W’, 1), (‘O’, 1), (‘R’, 1), (‘L’, 1), (‘D’, 1)]
[(‘HELLO WORLD’, 11)]
none of the mentioned
x = [i**+1 for i in range(3)]; print(x);
[0, 1, 2]
[1, 2, 5]
error, **+ is not a valid operator
error, ‘;’ is not allowed
What will be the output of the following Python code snippet?
d = {"john":40, "peter":45}
print(list(d.keys()))
[“john”, “peter”]
[“john”:40, “peter”:45]
(“john”, “peter”)
(“john”:40, “peter”:45)
What will be the output of the following Python code?
print("abc DEF".capitalize())
abc def
ABC DEF
Abc def
Abc Def
print([i.lower() for i in "HELLO"])
[‘h’, ‘e’, ‘l’, ‘l’, ‘o’]
‘hello’
[‘hello’]
hello
Which method from the options given below can Read large text presented as comma-separated values?
read_json
read_pickle
read_hdf
read_csv
Which of the following can be used to make a Dataframe?
Series
DataFrame
Structured ndarray
All of the above
If data is an ndarray, the index length must be the same as the length of the data .
True
False
What is the order of a matrix in Python?
number of rows X number of columns
number of columns X number of rows
number of rows X number of rows
number of columns X number of columns
Which of the following is not a Python built-in function:
map()
diff()
isinstance()
round()
Which of these measures are used to analyze the central tendency of data?
Mean and Normal Distribution
Mean, Median and Mode
Mode, Alpha & Range
Standard Deviation, Range and Mean
Which of the following measures of central tendency will always change if a single value in the data changes?
Mean
Median
Mode
All of these
Below are the distributions for Negatively, Positively and no skewed curves. Which one has: Mode<Median<Mean
A
B
C
Standard deviation can be negative.
True
False
Standard deviation is robust to outliers?
TRUE
False
The standard normal curve is symmetric about 0 and the total area under it is 1.
TRUE
FALSE
Suppose you have been given a variable V, along with its mean and median. Based on these values, you can find whether the variable “V” is left skewed or right skewed for the condition:
mean(V) > median(V)
TRUE
FALSE
type(range(5))
int
list
range
object
