wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Git_Python

Total questions: 20

Worksheet time: 20mins

Name
Class
Date
1.

What's a shortcut to staging all the changes you have?

a)

git commit add .

b)

git commit .

c)

git add .

d)

git push -am "Message

2.

How do you supply a commit message to a commit?

a)

git message "I'm coding"

b)

git add "I'm coding"

c)

git commit "I'm coding"

d)

git commit -m "I'm coding"

3.

What is the correct commit syntax for all changes with a message?

a)

git message -am "I'm coding"

b)

git add -a "I'm coding"

c)

git commit -a "I'm coding"

d)

git commit -am "I'm coding"

4.

Which command is used to show limited number of commits?

a)

git fetch

b)

git log -n

c)

git config

d)

git status

5.

Git command to compare two specified branches?

a)

git diff

b)

git merge

c)

git blame -L

d)

git push --tags

6.

The git clone command does which of the following?

a)

Makes a local copy of the repository

b)

Creates a working directory

c)

Commits a new branch

d)

Both 1 & 2

7.

Git is a -- ………………… version control system.

a)

Decentralized

b)

Centralized

c)

None of the above

8.

Syntax error in python is detected by _________at _______

a)

compiler/ compile time

b)

interpreter/ run time

c)

compiler/ run time

d)

interpreter/ compile time

9.

Which method is used to convert raw byte data to a string?

a)

Encode()

b)

Decode()

c)

Convert()

d)

tostring()

10.

Analyze the code −

print(''Recursive Function'')

def factorial(n):

return(n*factorial(n-1))

factorial(4)

a)

Recursive Function 24.

b)

Recursive Function.

c)

Function runs infinitely and causes a StackOverflowError.

d)

Syntax Error.

11.

Which operator has higher precedence in the following list

a)

% Modulus

b)

& BitWise AND

c)

**, Exponent

d)

> Comparison

12.

What is the maximum value for an integer in Python 3?

a)

2^63-1

b)

32767

c)

65536

d)

No limit

13.

How do you denote the end of a block in Python 3?

a)

By indenting the next line less than the current

b)

With a semicolon }

c)

With the end keyword

d)

With a backslash \

14.

In the following code, how many objects and references does Python create?

name = ‘Ayushi’

fname = name

a)

One object, one reference

b)

One object, two references

c)

Two objects, one reference

d)

Two objects, two references

15.

According to PEP 8, what case should you use for variable names with more than one word?

a)

Camel case

b)

Pascal case

c)

Snake case

d)

Kebab case

e)

Upper case with snake case

16.

What is the size of an empty tuple in Python?

a)

0 bytes

b)

8 bytes

c)

32 bytes

d)

48 bytes

17.

GIT belongs to the ………………………. Generation of Version Control tools.

a)

2nd

b)

3rd

c)

4th

d)

5th

18.

What language is used in GIT?

a)

C

b)

HTML

c)

PHP

d)

C++

e)

Java

19.

What files is this .gitignore programmed to leave out?


#.swift

build/


*.txt

*.metadata

a)

All files with a .swift, .txt, or metadata file extension, as well as the entire build directory

b)

Only the build directory

c)

All files in the build directory, as well as files ending with .txt or .metadata

d)

Only files with .swift and .txt extensions.

20.

What commands would you use to force an overwrite of your local files with the master branch?

a)

git pull --all

git reset --hard origin/master

b)

git pull -u origin master

git reset --hard master

c)

git pull origin master

git reset --hard origin/myCurrentBranch

d)

git fetch --all

git reset --hard origin/master