Questions: 5 831

Answers by our Experts: 5 728

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Input one string and one integer, make sure they are on different lines.


Print out the string and integer in one line separated by a space.

Run this code on python and takes a photo of the codes and the output: Show it to me


main_list = []

x = {}


field_names = [ "City name", "Area", "Population", "Annual Rainfall"]


list1 = [

["Adelaide", 1295, 1158259, 600.5],

["Brisbane", 5905, 1857594, 1146.4],

[ "Darwin", 112, 120900, 1714.7],

["Hobart", 135, 20556, 619.5],

["Sydney", 2058, 4336374, 1214.8],

["Melbourne", 1566, 3806092, 646.9],

["Perth", 5386, 1554769, 869.4]


]


for i in range(0, len(list1)):

for key in field_names:

#Below lines indented

for value in list1[i]:

x[key] = value



list1[i].remove(value)

break

main_list.append(x)

print(main_list)


Run this code and take a photos of code and the output on python


from prettytable import PrettyTable

table = PrettyTable()




table.field_names = ["pokemon name", "type"]


table.add_row(["pikachu", "Electric"])


table.add_row(["sydney", "Dark"])


table.add_row(["charmander", "Fire"])


table.add_row(["squite", "Water"])


print(table)


The manager of company has asked his assistant to present him with 

the list the ages of all the workers working in manufacturing division 

who are having the experience of 20 years. The assistant of thee 

manager replied him with the list of 10 employees who are having the

experience of 20 years. Write a program that store the age of all 15

employees in 1D array and then print the total count of employees

whose age lies between 50 and 60. Use functions to solve this task 

PLEASE SOLVE IT  USING PYTHON


Input Format ->57 49 54 48 59 55 46 57 58 60 58 62 56 70 73

Constraints-> The Age of the employees should be greater than or equal to 40 and less than or equal to 60. If constraints do not match then show "wrong input"

Output Format - EXAMPLE 8 EMPLOYEES


Run this code and recheck the wrong, and show me the codes and the output



class AddColumn:

def add_column(str1,list1):

dict1[str1].append(list1)

x=AddColumn()

x.add_column( "City name",["Adelaide", "Brisbane", "Darwin", "Hobart", "Sydney", "Melbourne", "Perth"])

x.add_column("Area", [1295,5905, 112, 1357, 2058, 1566, 5386])

x.add_column("Population", [1158259, 18557594, 120900, 205556, 4336374, 3306092, 1554769])

x.add_column("Annual Rainfall"[600.5, 1146.4, 1714.7, 619.5, 1214.8, 646.9,869.4])


print(dict1)


Create a program wherein any user should be able to borrow books. Each of the book must have three copies. Indicate how many books are left when they want to borrow a book. Users should be able to check-out and reserve any copy.


2. Which Color?

My favorite color is blue. What's your favorite color? Never mind it doesn't matter, as long as you know how to identify which color is given.


Instructions:

  1. Input a string that represents a color.
  2. Print "Red" if the color is red, "Blue" if it is blue, "Green" if it is green, and "None of the Above" if it isn't any of the three colors.
  3. Inputting the strings "ReD" or "rED" should still output "Red", this also applies to the other colors, so make sure to use one of the functions discussed previously!

Input

A line containing a string.

red

Output

A line containing a string.

Red
  1. Given an integer and specific digit between (0-9) write a program to print the count of a given specific digit in the given integer

Example

Input: 2343243233

Input: 3

Output: 5




  1. Given a string that other than letters, numbers, and space if any characters are there print the count of those characters.

Example

Input: aaa34@raj?where454/

Output: 3




An e-commerce application wants to give discounts to its customers. The discount is calculated as the product of the sum of even numbers and the sum of odd numbers present in the bill. Print the discount that a customer can get.

  1. Input: 2345, Output: 48 

Explanation: even_sum = 2+4 = 6.

Odd_sum = 3+5 = 8.

Product = 6*8 = 48.


LATEST TUTORIALS
APPROVED BY CLIENTS