PYTHON - True or False and Fill in the Blank

 

PYTHON

Write the following True or False

1.       Python is a high-level programming language.

Ans- True

 

2.       Python was created by James Gosling.

Ans-False -(Python was created by Guido van Rossum.)

 

3.       Python uses indentation to define code blocks.

Ans-True

 

4.       Strings in Python must be enclosed in double quotes.

Ans-False (Strings can be enclosed in single or double quotes.)

 

5.       The int data type represents floating-point numbers.

Ans-False (int represents integers.)

 

6.       Python has built-in functions such as print().

Ans-True

 

7.       The == operator checks if two values are equal.

Ans-True

 

8.       In Python, all functions must be defined before they are called.

Ans-True

 

9.       Python supports multiple numeric types including int, float, and complex.

Ans-True

 

10.     Whitespace is not significant in Python syntax.

Ans-False (Whitespace is significant in Python.)

11.     Python does not support user-defined functions.

Ans-False (Python supports user-defined functions.)

 

12.     The len() function returns the length of a list or string.

Ans-True

 

13.     Python is case-insensitive when it comes to variable names.

Ans-False (Python is case-sensitive.)

 

14.     The print() function can only print strings.

Ans-False (The print() function can print various data types.)

 

15.     In Python, float is used for decimal numbers.

Ans-True

 

16.     The + operator in Python can be used to concatenate strings.

Ans-True

 

17.     The str data type represents numbers in Python.

Ans-False (str represents strings of text.)

 

18.     Python supports both single and multi-line comments.

Ans-True

 

19.     The input() function is used to get user input in Python.

Ans-True

 

20.     In Python, 0 and False are considered equal.

Ans-True

 

 


Fill in the Blanks

1.       Python is a __________ programming language.

high-level

 

2.       Python was created by __________.

Guido van Rossum

 

3.       Strings in Python can be enclosed in __________ or __________ quotes.

Single or double

 

4.       The int data type represents __________ numbers.

integer

 

5.       The print() function is a __________ function in Python.

built-in

 

6.       The == operator is used to check for __________ between two values.

equality

 

7.       The range() function generates a sequence of __________.

numbers

 

8.       Functions created by users are called __________ functions.

user-defined

 

9.       The len() function returns the __________ of an object.

length

 

10.     In Python, variable names are __________-sensitive.

case

 

11.     The input() function is used to get __________ from the user.

input

 

12.     To combine two strings in Python, use the __________ operator.

+

 

13.     The float data type represents __________ numbers.

decimal

 

14.     Lists in Python are __________, meaning they can be modified.

mutable

 

15.     Python supports __________ comments for documentation purposes.

multi-line

 

16.     The type() function returns the __________ of an object.

type

 

17.     Python uses __________ to delimit strings.

quotes

 

18.     The range() function starts at __________ by default.

0

multiple

 

19.     The def keyword is used to __________ a function in Python.

define

Post a Comment

0 Comments