NEW
Font size
WorksheetsUSM-Micron Python Basic Introductory Workshop
Total questions: 15
Worksheet time: 15mins
1.Which of the following is the coding rule of Python Programming?
A. Case sensitive
B. Indentation
C. Punctuation
D. All of above
2.What is the output of the code below?
A. 3
B. 5
C. a=3
D. A=5
3.What is the correct syntax to output “My name is John” in Python?
A. print(“My name is John”)
B. input(“My name is John”)
C. print(My name is John)
D. input(My name is John)
4,How do you insert Comments in Python?
A. //This is a comment
B. /*This is a comment*/
C. **This is a comment
D. #This is a comment
5. What is the data types of the variable, name = “John”?
A. Integer
B. String
C. Float
D. Bool
6. What is the data types of the variable, x = input(“number1:”) ?
A. Integer
B. Float
C. String
D. Bool
7. What is the output of the code below?
x = 5.7859
y = int(x)
print(y)
A. 5.78
B. 5.7859
C. 5.0000
D. 5
8. How do we perform floor division in Python?
A. 7+5
B. 8//5
C. 9%6
D. 7/2
9. What is the output of the code below?
num1 = 9
num2 = 2
ans = num1// num2
print(ans)
A. 4.5
B. 4.0
C. 4
D. 5
10. What is the output of the following code?
A. 3
B. 0
C. 6
D. 9
11. Is the following statement true?
1==5 and 7>3
A. True
B. False
12. Is the following statement true?
8>4 or 7<2
A. True
B. False
13. How do you write an if statement in Python?
A. if x>y
B. if (x>y)
C. if x>y then
D. if x>y:
14. What is the error of the code below?
A. Expect Indentation before ‘if’
B. Expect Indentation before ‘print’
C. Letter ‘p’ of ‘print’ should be Capital Letter
D. All of above
15. What should be filled in the blank to print “True” when a is greater than b?
A. if , <
B. else , <
C. if , >
D. else , >
