100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
python programming language model paper:-02 $7.99   Add to cart

Class notes

python programming language model paper:-02

 1 view  0 purchase
  • Course
  • Institution

I will give you the nice python programming notes so you can easy to learn and improve you coding skills and also give you the all basic coding notes if you guys want to learn easy then perched my notes. I was full struggle for this notes and I have full experience you guys have any daut the DM me.

Preview 3 out of 22  pages

  • April 1, 2023
  • 22
  • 2022/2023
  • Class notes
  • Dr. bhaviya
  • All classes
avatar-seller
MODEL QUESTION PAPER-3


Time: 2 1/2 Hours Max Marks 60
Instruction Answer any Question from each Part
PART-A (4x2=8)
I. Answer any Four questions. Each question carries 2 Marks.
1. Why Python is called as Dynamic and Strongly Types Language?
Dynamically-typed means that, unlike other programming languages, in Python, we
need not declare the data type of a variable explicitly. The data type of the variable
is decided at the run time. Apart from this one variable can be used to store different
types of data at different instances in the program.
Strong typing means that variables do have a type and that the type matters when
performing operations on a variable. Due to strong typing, types need to be
compatible with respect to the operand when performing operations. For example
Python allows one to add an integer and a floating point number, but adding an
integer to a string produces error.


2. How to read and write data in Python?
 Read Only (‘r’) : Open text file for reading. The handle is positioned at the
beginning of the file. If the file does not exists, raises the I/O error. This is
also the default mode in which a file is opened.
 Read and Write (‘r+’): Open the file for reading and writing. The handle is
positioned at the beginning of the file. Raises I/O error if the file does not
exist.
 Write Only (‘w’) : Open the file for writing. For the existing files, the data is
truncated and over-written. The handle is positioned at the beginning of the
file. Creates the file if the file does not exist.
 Write and Read (‘w+’) : Open the file for reading and writing. For an existing
file, data is truncated and over-written. The handle is positioned at the
beginning of the file.

,3. Write the syntax of while and for loop
While loop :
Syntax :
While expression:
Statement(s)


For loop :
Syntax:
For iterator_var in sequence:
Statements(s)


4. How to traverse a dictionary?
 Iterating through keys directly
 Iterating using keys()
 Iterating using values()
 Iterating using items ()


5. What is Pickling and Unpickling?
Pickling or Serialization: The process of converting a Python object into a byte
stream representation using the pickle module is called pickling or serialization.
The pickle.dump() method is used to store the python object to the file.


Unpickling or Deserialization: The process of converting a byte stream
representation back into a Python object using the pickle module is called
unpickling or deserialization. The pickle.load() method is used to retrieve pickled
data from the file.

, 6. What is JSON?
JSON stands for JavaScript Object Notation, which is a text-based, human-
readable format for presenting structured data. It’s used to transmit data
between a server and a client, or between dient applications.




PART-B
II. Answer any Four questions. Each question carries 5 marks. 14×5=20
7. Explain different string formatting methods in Python




8. Explain continue and break statements with an example.
The Break Statement : The break statement or keyword is used to terminate the
loop The break can automatically put a stop to the execution of a looping
statement, even if the logical expression has not become False, or even When
iterating the sequence of items in a sequence has not been completely finished.

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller ajeetkumar2. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $7.99. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

76669 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$7.99
  • (0)
  Add to cart