1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Natali5045456 [20]
3 years ago
7

write a python function that takes string j and returns a dictionary showing number of letters and digits in j. The returned dic

tionary is supposed to have two keys digits and letters. you can take advantage of isdigit() and isalpha() which are methods for string objects showing if a string is digit

Computers and Technology
1 answer:
k0ka [10]3 years ago
3 0

Explanation:

def letterDigitCount(j):

dic={"digits":0,"letters":0}

for a in j:

if a.isdigit():

dic["digits"]+=1

elif a.isalpha():

dic["letters"]+=1

return dic

You might be interested in
What are voter purges
diamong [38]

Answer:

Voter registration lists, also called voter rolls, are the gateway to voting because a citizen typically cannot cast a vote that will count unless his or her name appears on the voter registration rolls. State and local officials regularly remove—or purge—citizens from voter rolls. In fact, 39 states and the District of Columbiareported purging more than 13 million voters from registration rolls between 2004 and 2006.

Explanation:

7 0
3 years ago
Assignment 1: silly sentences edhesive
Genrish500 [490]

Answer:

print("Let's play Silly Sentences!")

print(" ")

name=input("Enter a name: ")

adj1=input("Enter an adjective: ")

adj2=input("Enter an adjective: ")

adv=input("Enter an adverb: ")

fd1=input("Enter a food: ")

fd2=input("Enter another food: ")

noun=input("Enter a noun: ")

place=input("Enter a place: ")

verb=input("Enter a verb: ")

print(" ")

print(name + " was planning a dream vacation to " + place + ".")

print(name + " was especially looking forward to trying the local \ncuisine, including " + adj1 + " " + fd1 + " and " + fd2 + ".")

print(" ")

print(name + " will have to practice the language " + adv + " to \nmake it easier to " + verb + " with people.")

print(" ")

print(name + " has a long list of sights to see, including the\n" + noun + " museum and the " + adj2 + " park.")

Explanation:

Got it right. Might be a longer version, but it worked for me.

6 0
2 years ago
Bukod sa nakasulat na impormasyon ay makakakita rin ng larawan sa internet.​
faltersainse [42]

i woud love to help but i dont understand the language

7 0
2 years ago
Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum
otez555 [7]

Answer:

Explanation:

#Using python to create the list

#first we create an empty list to store our numbers.

import math

data = []

x = 0

InputSum = 0

NumInput=int(input("how many number do you want to add"))

while x <=(NumInput):

   Input=int(input("Enter the numbers here"))

   data.append(Input)

   x = x+1

   InputSum = InputSum + Input  #this is to add the numbers entered

print("The number you entered are ")

print(*data)  #this print the numbers entered

print("The sum of the numbers is", InputSum)

3 0
3 years ago
In microsoft word, when you highlight existing text you want to replace you are
RSB [31]
You are changing the word
8 0
2 years ago
Other questions:
  • Where are Micro USB connectors used the most?
    11·2 answers
  • How to get 60 fps pubg​
    9·2 answers
  • The _____ class can be used to get user input using dialog boxes.
    14·1 answer
  • Which software is primarily used to create
    15·2 answers
  • What is the phase of a waveform ?
    15·1 answer
  • Look at the four schematic symbols shown in the figure above. Each of the symbols is labeled with a number. Which of the followi
    11·1 answer
  • Is there anyone that knows how to work in Microsoft Access and someone that could help me on my test at 11 30am?​
    7·1 answer
  • 60 POINTS IF YOU GET IT RIGHT
    6·2 answers
  • Which step in the software development life cycle involves making improvements based on user feedback?
    15·1 answer
  • If Anyone can help me out that'll be great
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!