Menu

Fashion Trendy
  • Drop Down

    • Abstract
    • Model
    • Techo
    • Options
  • Photography Pictures Product

    Drop Menu

    • Crystal
    • Digital
    • Graphs
    • Settings
  • Menu

    THE HONEST VISIONS

    Header Background

    Header Background
    Header Background Image. Ideal width 1600px with.
    • Home
    • Digital Art
      • Pics
        • SEO 1
        • SEO 2
      • CSS
        • CSS 1
        • CSS 2
        • CSS 3
        • CSS 4
        • CSS 5
      • Jquery
        • Jquery 1
        • Jquery 2
    • Fashion
      • Product 1
        • Sub Item
        • Sub Item
      • Product 2
        • Sub Item
        • Sub Item
    • Photography
    • Design
    Go
    Home » TCS PA » TCS python Proctored Assessment 17th December solution

    TCS python Proctored Assessment 17th December solution







    Q1. Create a class Payslip having attributes basicSalary,hra and ita.Create a class PaySlipDemo containing a method getHighestPF with takes list of payslip objects and return the highest PF among the objects.PF should be 12% of basic salary.

    Sample Input:

    2

    10000

    2000

    1000

    50000

    3000

    2000


    Sample Output:

    6000

    Solution :

    class PaySlip:
    def __init__(self,basicSalary,hra,ita):
    self.basicSalary=basicSalary
    self.hra=hra
    self.ita=ita

    class PaySlipDemo:
    def getHighestPF(self,paylist):
    pflist=[]
    for i in paylist:
    pf=0.12*basicSalary
    pflist.append(pf)
    print(max(pflist))


    if __name__=='__main__':
    count=int(input("Enter the number of times you want to input payslip data\n"))
    paylist=[]
    for i in range (count):
    basicSalary=int(input("Enter basic salary\n"))
    hra = int(input("Enter hra\n"))
    ita= int(input("Enter ita\n"))
    paylist.append(PaySlip(basicSalary,hra,ita))
    PaySlip=PaySlipDemo().getHighestPF(paylist)

    Output:

     2
    10000
    2000
    1000
    50000
    3000
    2000
    6000.0


    Q2.Create a class Stock having attributes StockName,StockSector,StockValue.    Create a class StockDemo having a method getStockList with takes a list        of Stock objects and a StockSector(string) and returns a list containing stocks      of the given sector having value more than 500.


    Sample Input:

    3

    TCS

    IT

    1000

    INFY

    IT

    400

    BMW

    Auto

    1200

    IT


    Sample Output:

    TCS       



    Solution :


    class Stock:
    def __init__(self,StockName,StockSector,StockValue):
    self.StockName=StockName
    self.StockSector=StockSector
    self.StockValue=StockValue

    class StockDemo:
    def getStockList(self,olist,StockSector):
    stockList=[]
    for i in olist:
    if i.StockValue>500:
    stockList.append(i.StockName)
    return (stockList)

    if __name__=='__main__':
    count=int(input("Enter how many stocks you want to enter\n"))
    olist=[]
    for i in range (count):
    StockName=input("enetr stock name\n")
    StockSector=input("enter stock sector\n")
    StockValue=int(input("enter stock value\n"))
    olist.append(Stock(StockName,StockSector,StockValue))
    StockSector1=input("enter the stock sector for more specification")
    output=StockDemo().getStockList(olist,StockSector1)
    for j in output:
    print(j)
    Output:

    3
    TCS
    IT
    1000
    INFY
    IT
    400
    BMW
    AUTO
    1200
    IT
    TCS
    theinfinitevisions
    2 Comments
    TCS PA
    Thursday, August 13, 2020

    facebook

    twitter

    google+

    fb share

    About theinfinitevisions

    Related Posts
    < Previous Post

    2 comments

    avatar
    Reply
    theinfinitevisions delete August 13, 2020 at 10:25 PM

    hey please post all pa and opas answers

    avatar
    Reply
    theinfinitevisions delete August 13, 2020 at 10:25 PM

    sure and thanks for watching my blog.

    Powered by Blogger.

    Comments

    3-comments

    Comments

    FOLLOW ME

    LATEST

    3-latest-65px

    Facebook


    Top Links Menu

    • 9096307522
    • adarsh8794@gmail.com

    Report Abuse

    Top Links Menu

    • Instagram
    • YouTube
    • Facebook
    • Twitter

    Why did the Chinese soldiers cry before going to the Indo-China border

    Why did the Chinese soldiers cry before going to the Indo-China border? Read on Seeing the power of Indian troops on the Indo-China border, ...

    Menu based on Icons

    • Home
    • catagories
    • Item
    • Item
    • Contact us

    Total Pageviews

    Sections


    Campus

    Courses

    Testimonials

    Blog Archive

    • ▼  2020 (28)
      • ►  September (10)
      • ▼  August (18)
        • All About Former President of India Pranab Mukherjee
        • All about Chadwik Aaron Boseman (1976-2020)
        • 5 Amazing and interesting movies to watch in 2020 ...
        • 5 Amazing and interesting movies to watch in 2020 ...
        • 5 Amazing and interesting movies to watch in 2020 ...
        • 5 Amazing websites for watching Hindi movies onlin...
        • 10 amazing facts about Suashant singh rajput you d...
        • 10 Amazing facts about Indian politics you definit...
        • Ganesh Chaturthi one of the greatest event celebr...
        • TCS python Proctored Assessment 10th february solu...
        • TCS python Proctored Assessment 25th January solution
        • 10 amazing websites you definitely don’t know abou...
        • 10 Amazing websites you definitely don't know abo...
        • TCS python Proctored Assessment 15th January sulution
        • 10 Superstitions In India and There scientific rea...
        • Celebrating 74th Independence Day of INDIA...
        • TCS python Proctored assessment 28th December solu...
        • TCS python Proctored Assessment 17th December solu...

    You Tube Videos

    Campus

    4-tag:Campus-500px-mosaic

    Ad Home

    About

    This just a demo text widget, you can use it to create an about text, for example.

    Testimonials

    3-tag:Testimonials-250px-testimonial

    Main Menu

    • About
    • Home
    • Catagories
    • -Item
    • -Item
    • -Superstitions
    • -Social
    • -Movies
    • -Facts
    • -Amazing websites

    Random Posts

    Recent Posts

    Header Ads

    Popular Posts

    • Celebrating 74th Independence Day of INDIA...
      Independence day-                          Independence day in India is celebrating annually on 15th august i.e on the same day 74 years be...
    • 10 Superstitions In India and There scientific reasons part 1
      1)Lemon & Green Chillies:           Superstition-   This one is the most common one and many of us do it without knowing the reason. No ...
    • TCS python Proctored Assessment 2nd March solution
        Q1 . GIVEN some strings in that we need to print the strings which don't contain vowels in it. Input 1:            4         avoid    ...
    • TCS python Proctored Assessment 15th January sulution

    Logo

    Logo
    Logo Image. Ideal width 300px.

    Section Background

    Section Background
    Background image. Ideal width 1600px with.

    Section Background

    Section Background
    Background image. Ideal width 1600px with.

    Ads block

    Banner 728x90px

    Blogs

    Section Background

    Section Background

    ABOUT

    theinfinitevisions
    View my complete profile

    Contact us-desc:Feel free to contact us at anytime about our courses and tutorials.

    Name

    Email *

    Message *


    Categories

    actors actress adventure Amazing websites America Bangla Black panther Chadwick Boseman cinema Clothing comedy Congress crime cristopher nolan DC Death Defence Minister drama Facts Famous film filmcommunity filmmaker Finance Minister hollywood horror INC India Indira Gandhi instagram Marvel MCU minister Movies netflix politics Pranab Mukherjee president Rajiv Gandhi science fiction Social Soniya Gandhi Stan lee Superstitions TCS PA theatre TV Shows

    Follow Us

    Sponsor

    SEARCH

    FOLLOW ME

    Popular

    • Celebrating 74th Independence Day of INDIA...
      Independence day-                          Independence day in India is celebrating annually on 15th august i.e on the same day 74 years be...
    • 10 Superstitions In India and There scientific reasons part 1
      1)Lemon & Green Chillies:           Superstition-   This one is the most common one and many of us do it without knowing the reason. No ...
    • TCS python Proctored Assessment 2nd March solution
        Q1 . GIVEN some strings in that we need to print the strings which don't contain vowels in it. Input 1:            4         avoid    ...

    Social Share

    Weekly Posts

    • Celebrating 74th Independence Day of INDIA...
      Independence day-                          Independence day in India is celebrating annually on 15th august i.e on the same day 74 years be...
    • 10 Superstitions In India and There scientific reasons part 1
      1)Lemon & Green Chillies:           Superstition-   This one is the most common one and many of us do it without knowing the reason. No ...
    • TCS python Proctored Assessment 2nd March solution
        Q1 . GIVEN some strings in that we need to print the strings which don't contain vowels in it. Input 1:            4         avoid    ...

    Like us On Facebook

    Labels

    • actors (7)
    • actress (4)
    • adventure (7)
    • Amazing websites (3)
    • America (2)
    • Bangla (1)
    • Black panther (2)
    • Chadwick Boseman (1)
    • cinema (5)
    • Clothing (3)
    • comedy (5)
    • Congress (1)
    • crime (5)
    • cristopher nolan (5)
    • DC (5)
    • Death (2)
    • Defence Minister (1)
    • drama (5)
    • Facts (2)
    • Famous (3)
    • film (6)
    • filmcommunity (6)
    • filmmaker (6)
    • Finance Minister (1)
    • hollywood (5)
    • horror (4)
    • INC (1)
    • India (3)
    • Indira Gandhi (1)
    • instagram (4)
    • Marvel (6)
    • MCU (2)
    • minister (1)
    • Movies (3)
    • netflix (5)
    • politics (1)
    • Pranab Mukherjee (1)
    • president (1)
    • Rajiv Gandhi (1)
    • science fiction (5)
    • Social (6)
    • Soniya Gandhi (1)
    • Stan lee (2)
    • Superstitions (1)
    • TCS PA (7)
    • theatre (5)
    • TV Shows (2)

    Copyright THE HONEST VISIONS 2014 . Template Created by