0% found this document useful (0 votes)
59 views3 pages

Python Fundamentals Worksheet

The document is a Python Fundamentals Worksheet designed for students to test their understanding of basic Python concepts through multiple choice questions, true or false statements, fill in the blanks, and practical applications. It covers topics such as the print() function, variable assignment, comments, and code debugging. The worksheet includes sections for different types of questions to assess comprehension and practical coding skills.

Uploaded by

Rajeev kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
59 views3 pages

Python Fundamentals Worksheet

The document is a Python Fundamentals Worksheet designed for students to test their understanding of basic Python concepts through multiple choice questions, true or false statements, fill in the blanks, and practical applications. It covers topics such as the print() function, variable assignment, comments, and code debugging. The worksheet includes sections for different types of questions to assess comprehension and practical coding skills.

Uploaded by

Rajeev kumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Python Fundamentals Worksheet

Name: _________________________
Date: _________________________
Class: _________________________

Instructions: Read the questions carefully and answer based on your


understanding from the chapter.

Section A: Multiple Choice Questions (1 mark each)

1. What is the primary function of the print() command in Python?


a) To get input from the user
b) To perform mathematical calculations
c) To display output on the screen
d) To create a new variable

2. Which symbol is used to display text on a new line within a


single print() statement?
a) ,
b) ;
c) \n
d) //

3. Look at the following code:

print("The answer is", 10)

What will be the output?


a) The answer is10
b) The answer is,10
c) The answer is 10
d) It will cause an error

4. What is the purpose of a comment in a Python program?


a) To make the program run faster
b) To provide explanations that are ignored by Python
c) To display hidden output for the user
d) To connect to the internet

5. Which of the following is the correct way to write a single-line


comment?
a) // This is a comment
b) /* This is a comment */
c) # This is a comment
d) -- This is a comment
Section B: True or False (1 mark each)

1. print(5 + 3) will output the string "5+3".

 True / False

2. In the code message = "Hello", the word message is a variable.

 True / False

3. A variable name can start with a number.

 True / False

4. The value of a variable can be changed after it is created.

 True / False

5. Print() and print() are the same command in Python.

 True / False

Section C: Fill in the Blanks (1 mark each)

1. The set of rules for writing commands in a program is called _______________.


2. To save a program with multiple commands and run it all at once, we use the
_______________ mode in IDLE.
3. The _______________ operator (=) is used to assign a value to a variable.
4. To display both the text "Total score:" and the value 95 in one print statement, you
would write: print("Total score:", _____).
5. A quantity like 7 or 12 that has a fixed value is called a _______________.

Section D: Practical Application

1. Predict the Output: What will be the output of the following code? (2 marks)

gold = 500
print("Initial gold:", gold)
gold = gold - 150
print("Gold after spending:", gold)
Output: ____________________________________________________

2. Debug the Code: This code is supposed to print a two-line message but
contains an error. Correct it. (2 marks)

print("First line\nSecond line")

Corrected Code: ____________________________________________

3. Write a Program: Write a complete Python program in script mode that does
the following: (4 marks)

1. Creates a variable called player_name and assigns it your name.


2. Creates a variable called player_score and assigns it a value of 100.
3. Prints a message that says: "[Your Name] has scored 100 points!" using the variables.

Your Code:

You might also like