Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Python: All Recent Posts Grouped
Concept Learning Code Sheets View all
Simple Print Variations #6732  (12-Feb-2019)
In Topic(s) : Beginning To Program   

Some simple variations to print() function


Hello World Printing #4871  (9-Nov-2018)
In Topic(s) : Beginning To Program   

Hello world program


Solved ProblemsView all
B04C-2019S-C2 #7158 (11-Apr-2019)

Considering the following definition of class DOCTORS, write a method/function SPLDOCS() in python to search and display all the content from a pickled file DOCS.DAT, where Specialisation of DOCTORS is “CARDIOLOGY”.

class DOCTORS:
def __init__(self,N,S):
  self.Name=N
  self.Specialisation=S
def Disp(self):
  print self.Name, "#", self.Specialication

 

Considering the following definition of class DOCTORS, write a method/functio


B04C-2019S-C1 #7156 (11-Apr-2019)

Considering the following definition of class STOCK, write a method/function COSTLY() in pyhton to search and display Name and Price from a pickled file STOCK.DAT, where Price of the items are more than 1000.

class Stock:
  def __init__(self, N, P):
    self.Name=N
    self.Price=P
  def Show(self) :
    print self.Name, "@", self.Price

Considering the following definition of class STOCK, write a method/function


B04B-2019S-C2 #7154 (11-Apr-2019)

Write a method/function AEDISP() in python to read lines from a text file WRITER.TXT, and display those lines, which are starting either with A or starting with E.

Write a method/function AEDISP() in python to read lines from a text file WRI


B04B-2019S-C1 #7152 (11-Apr-2019)

Write a method/function ISTOUPCOUNT() in python to read contents from a text file WRITER>TXT, to count and display the occurrence of the word “IS” or “TO” or “UP”.

For example:

If the content of the file is

IT IS UP TO US TO TAKE CARE OF OUR SURROUNDING. IT IS NOT POSSIBLE ONLY FOR THE GOVERNMENT TO TAKE RESPONSIBILITY

The method/function should display

Count of IS TO and UP is 6

Write a method/function ISTOUPCOUNT() in python to read cont


B04A-2019S-C2 #7150 (11-Apr-2019)

Write a statement in Python to open a text file README.TXT so that existing content can be read from it.

Write a statement in Python to open a text file README.TXT s


B04A-2019S-C1 #7148 (11-Apr-2019)

Write a statement in Python to open a text file WRITEUP.TXT so that new content can be written in it .

Write a statement in Python to open a text file WRITEUP.TXT


B03E-2019S-C2 #7145 (11-Apr-2019)

Convert the following Infix expression to its equivalent Postfix expression, showing the stack contents for each step of conversion:

A + B * C ^ D – E

Convert the following Infix expression to its equivalent Postfix expression,


B03E-2019S-C1 #7143 (11-Apr-2019)

Evalute the following Postfix expression, showing the stack contents:

 250,45,9,/,5,+,20,*,-

Evalute the following Postfix expression, showing the stack contents:


B03D-2019S-C2 #7141 (11-Apr-2019)

Write a python method/function Count3and7(N) to find and display the count of all those numbers which are between 1 and N,

which are either divisible by 3 or by 7.

For example :

If the value of N is 15

The sum should be displayed as 7

(as 3,6,7,9,12,14,15 in between 1 to 15 are either divisible by 3 or 7)

Write a python method/function Count3and7(N) to find and dis


B03D-2019S-C1 #7139 (11-Apr-2019)

Write a python method/function Swapper(Numbers) to swap the first half of the content of a list Numbers with second half of the content Numbers and display the swapped values.

Note: Assuming that the list has even number of values in it.

For example: if the list Numbers contains

[35, 67, 89, 23, 12, 45]

After swapping the list content should be displayed as

[23, 12, 45, 35, 67, 89]

Write a python method/function Swapper(Numbers) to swap the


Concept Notes and ResourcesView all

Salient Features: SIMPLE AS BASIC: Python is a sort of modern day BASIC language. BEGINNER TO ADVANCED: It is right for beginners and it is truly all purpose in modern times. Language for console applications, GUI applications, scientific applications and web applications. INTERPRETED: It is an interpreted language. This means that line by line error […]


Back