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

Python

Uploaded by

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

Python

Uploaded by

nvrcse2k23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

PYTHON PROGRAMMING SET:1

Read the paragraph and answer the following questions


Python is a high-level programming language known for its simplicity and readability. It was
created to make programming easier and more accessible. Python code looks like English, which
helps beginners understand programming concepts quickly. It is widely used in web
development, data analysis, artificial intelligence, automation, and more. Python is also open-
source, meaning anyone can use and modify it freely.

1. What kind of programming language is Python?


Answer: A high-level programming language.

2. Why is Python considered simple and readable?


Answer: Because its code looks like English.

3. Who is Python designed to help?


Answer: Beginners and programmers looking for easy-to-understand code.

4. Name two fields where Python is commonly used.


Answer: Web development and data analysis.

5. What does open-source mean in Python’s context?


Answer: Anyone can use and modify Python freely.

6. Is Python suitable for beginners?


Answer: Yes, because of its simple syntax.

7. What is one goal behind Python’s creation?


Answer: To make programming easier and more accessible.

8. Can Python be used for artificial intelligence?


Answer: Yes.

9. Does Python require a license fee?


Answer: No, it is free and open-source.

10. What is one advantage of Python's syntax?


Answer: It is easy to read and write.
PYTHON PROGRAMMING SET:2
Read the paragraph and answer the following questions
In Python, variables are used to store information such as numbers or text. You don’t have to
declare the type of a variable beforehand; Python figures it out automatically. Common data
types include integers, floats (decimal numbers), strings (text), and booleans (true or false).
Variables can change values, and you can perform operations like addition or string
concatenation with them.

1. What are variables used for in Python?


Answer: To store information.

2. Do you need to declare variable types in Python?


Answer: No, Python infers the type automatically.

3. Name three common data types in Python.


Answer: Integers, strings, booleans.

4. What data type represents decimal numbers?


Answer: Float.

5. Can variables change their values?


Answer: Yes.

6. What operation can you perform with string variables?


Answer: Concatenation (joining strings).

7. What does a boolean represent?


Answer: True or false values.

8. Is Python a strongly typed language?


Answer: Yes, but it infers types automatically.

9. Can you add two integers stored in variables?


Answer: Yes.

10. How does Python know a variable’s type?


Answer: It figures out automatically when you assign a value.
PYTHON PROGRAMMING SET:3
Read the paragraph and answer the following questions
Control structures help you decide the flow of a program. Python uses if, else, and elif
statements to run different code depending on conditions. Loops such as for and while allow
repeating a set of instructions multiple times. Proper indentation is important in Python to
show which code belongs to which block, making the program easier to read and less prone to
errors.

1. What are control structures used for in Python?


Answer: To control the flow of the program.

2. Which keyword is used for decision making?


Answer: if.

3. What does elif mean?


Answer: Else if; it checks another condition if the first is false.

4. Name two types of loops in Python.


Answer: for and while.

5. What is indentation used for in Python?


Answer: To show which code belongs to which block.

6. Why is indentation important in Python?


Answer: It makes code readable and avoids errors.

7. Can you run a block of code multiple times using loops?


Answer: Yes.

8. What happens if an if condition is false and there is no else?


Answer: The code inside the if block is skipped.

9. Can for loops iterate over a list?


Answer: Yes.

10. What does a while loop do?


Answer: Repeats code while a condition is true.

You might also like