IN THIS BLOGPOST ,I HAVE SHARED THE RECENTLY ASKED PYTHON QUESTION AND SOLUTION WHICH IS CERTAINLY USEFUL WHEN YOU WANT TO PRACTICE.HOPE THIS BLOG IS USEFUL TO YOU.
Write the code to define a class to create Ticket objects with the below attributes:
• id of the ticket, each ticket will have unique id
• ticket status, the status of the ticket
• ticket priority, represents the priority
Define a method in the class which takes values for ticket id, owner name, sla of the ticket as arguments in the given sequence and sets the value of attributes to parameter values passed when an object is created. For the ticket status and ticket priority attributes, default values "open" and "None" are assigned respectively.
Define a method in the class which takes values for ticket id, owner name, sla of the ticket as arguments in the given sequence and sets the value of attributes to parameter values passed when an object is created. For the ticket status and ticket priority attributes, default values "open" and "None" are assigned respectively.
Write the code to define a class to create Ultimatix objects with the below attributes:
• A List having Ticket objects Define a method in the class which takes parameter as described above. The method should set the value of attribute to parameter value while creating an object. Define a second method inside the Ultimatix class ALL Method will set a value for the ticket priority attribute of all Ticket objects in the List of Tickets of Ultimatix class based on the criteria mentioned below: .
• A List having Ticket objects Define a method in the class which takes parameter as described above. The method should set the value of attribute to parameter value while creating an object. Define a second method inside the Ultimatix class ALL Method will set a value for the ticket priority attribute of all Ticket objects in the List of Tickets of Ultimatix class based on the criteria mentioned below: .
Note: All searches/string comparisons should be case insensitive. Language You can use/refer the below given sample input and output to verify your solution using' Test against Custom Input 'option in Hackerrank.
ALL Note: In Python None means NULL Object. Instructions to write main section of the code
To create the list:
a. Read the count of Ticket objects you want to create.
b. Create a Ticket object after reading the data related to it and add the object to the list of ticket objects which will be provided to the Ultimatix object. This point repeats for the number of ticket objects (considered in the first line of input, point #c.i.a)
a. Read the count of Ticket objects you want to create.
b. Create a Ticket object after reading the data related to it and add the object to the list of ticket objects which will be provided to the Ultimatix object. This point repeats for the number of ticket objects (considered in the first line of input, point #c.i.a)
e. Call the second method defined in the Ultimatix class from the main section! f. Display the Ticket Id and the Priority value of all Ticket objects in the list of Tickets of the Ultimatix object created in point call above. While printing the value
• Ticket Id and Priority values should be separated by a blank space. The Ticket Id and Priority values for each ticket should be printed in a separate line. For ticket objects in the list, the values should be printed in ascending order of Ticket Id. For priority values, the first character of the value should be in uppercase and rest of the characters should be in lowercase.
g. Call the third method defined in the Ultimatix class by passing the string read in point d. If the value returned by the method is not None, display the value for ticket id and ticket status of all the Tickets in the list of Tickets of the Ultimatix object created in point c.ii. Otherwise, display the message "Oops.. No records found!" excluding! the quotes While printing the values: Language: Python 1 Enter your . Ticket id and ticket status values should be separated by a blank space. The ticket id and ticket status values for each ticket should be printed in a separate line. For ticket objects in the list, the values should be printed in ascending order of Ticket Id. For ticket status values, the first character of the value should be in uppercase and rest of the characters should be in lowercase. Please refer to the sample inputs/outputs for more clarity on input-output formats.
Sample 1:
Input:
4
1
Edward
3
4
Firoz
2
3
Jeenat
1
2
Thomas
1
High
Output:
1 Medium
2 High
3 High
4 High
1 Open
2 Closed
3 Closed
4 Closed
Sample 2: Input:
4
1
Edward
3
2
Thomas
1
3
Jeenat
1
4
Firoz
2
Low
Output:
1 Medium
2 High
3 High
4 High
Oops.. No records found!
IF YOUR CONFUSED AND DON'T KNOW HOW TO SOLVE THIS QUESTIONS. REFER TO THE BELOW VIDEO.I HAVE GIVEN DETAILED STRUCTURE TO FOLLOW AND EASIEST WAY TO SOLVE THIS QUESTION.
TCS IRA 28TH FEB PYTHON SOLUTION:
HOPE THIS IS HELPFUL TO YOU GUYS.IF YOU LIKE MY WORK ,CONSIDER SUBSCRIBING TO MY CHANNEL AND FOLLOW MY BLOGPOST FOR MORE UPDATES.
0 Comments