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

Write a Python program that takes a String as an input from the user and counts the frequency of each character using a dictionary. For solving this problem, you may use each character as a key and its frequency as values. [You are not allowed to use the count() function] Hint: You can create a new dictionary to store the frequencies. You may ignore case for simplicity (i.e. may consider P and p to be the same). =================================================================== Sample Input: "Python programming is fun" Sample Output: {'p': 2, 'y': 1, 't': 1, 'h': 1, 'o': 2, 'n': 3, 'r': 2, 'g': 2, 'a': 1, 'm': 2, 'i': 2, 's': 1, 'f': 1, 'u': 1} 


Suppose you have been given the following list of tuples.

list_1 = [("a", 1), ("b", 2), ("a", 3), ("b", 1), ("a", 2), ("c", 1)]

Write a Python program that converts this list of tuples into a dictionary and then prints the

dictionary.

[You are not allowed to use set]

Hint: Think of membership operators (in and not in).

===================================================================

Output:

{'a': [1, 3, 2], 'b': [2, 1], 'c': [1]}

===================================================================


Write a python program that takes an input from the user and finds the number of times that the



input is present in a given tuple.



===================================================================



Example 1:



Given tuple: (10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2)



Sample Input 1:



8



Sample Output 1:



8 appears 4 times in the tuple



===================================================================



Example 2



Given tuple: (10, 8, 5, 2, 10, 15, 10, 8, 5, 8, 8, 2)



Sample Input 2:



1



Sample Output 2:



1 appears 0 times in the tuple



===================================================================




Employee Record is composed of the following:

  • record_no
  • first_name
  • last_name
  • address
  • city
  • county
  • state
  • bdate
  • zip
  • phone1
  • phone2
  • email
  • web


In the given string, Each employee data is separated by comma (,). Each record is separated by semicolon (;).


A - The program must be able to display employee record based on the given key.

B - The program must be able to display the last name, first name and age of an

employee based on the given key. (assume that the current date is April 22, 2022)

C - The program must be able to display the number of employee in a given county.

D - The program must be able to count no. of employee based on a given email provider site.




1. data

Output


Enter·your·choice·(A/B/C/D/X-exit):·A
Enter·Record·No.:·10

First·Name:·Kris
Last·name:·Marrier
Address:·228·Runamuck·Pl·#2808
City:·Baltimore
County:·Baltimore·City
State:·MD
Birth·Date:·12/19/1983
zip:·21224
phone1:·410-655-8723
phone2:·410-804-4694
Email:·kris@gmail.com
web:·http://www.kingchristopheraesq.com

Enter·your·choice·(A/B/C/D/E/X-exit):·X
Bye!






Ram has a list containing 10 integers . you need to help him create a program with separate user defined function to perform the following operation based on this list

·     Push the even number into stack

·     Pop the content of the stack

·     Display content of the stack


write a program to find the least common multiple of the given two numbers Mand N

Complete the following print and if statements by accessing the appropriate elements from my_list. Hint: Use the list indexing notation []. print('My favorite color is', ???) print('I have {} pet(s).'.format(???)) if ???: print("I have previous programming experience") else: print("I do not have previous programming experience")


Assign your name to the variable name.

Q2: Assign your age (real or fake) to the variable age.

Q3: Assign a boolean value to the variable has_android_phone.

Q4: Create a dictionary person with keys "Name", "Age", "HasAndroidPhone" and values using the variables defined above.

Q4b Use a for loop to display the type of each value stored against each key in person. (Optional)


Given a four digit number N as input write a program to print first and last digit of the number

Given a list of integers, write a program to print the count of all possible unique combinations of numbers whose sum is equal to k.



Input:



The first line of Input will contain space-separated Integer.



The second line of Input will contain an 8nteger,denoting K.




Sample Input:



2 4 6 1 3




Output:



3

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS