Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help please # 3. Create three count variables: count-char, count_digit, count_punc. Iterate alphabetical the character is a digit (0-9) character is punctuation count punc counter.
Help please
# 3. Create three count variables: count-char, count_digit, count_punc. Iterate alphabetical the character is a digit (0-9) character is punctuation count punc counter. over the hw03 str string. If the character is (A-Za-z) increment the count char counter. If increment the count_digit counter. If the ( !@#5%^&* (l_+-.{ } [ ]!) the increment the Ignore all other characters. Print the counter names and the counts when #the iteration is complete. # Example: #countchar: 329 # count-digit: # count punc: 108 - in 4 - input( 'Enter a number for problem 4 (integer or float):') # 4. write a conditional to check if in 4 is a float or an integer. Print + integer' if in 4 is an integer and' [+] float' if the number if a float. # Example: # Enter a number for problem 4 (integer or float): # [+] integer # Enter a number for problem 4 (integer or float): 3.14 # [+] float # 5 Write a program using a while loop that asks the user for a number or to just enter to quit the program # If the user enters a number, the program should add the entered number to the total sum. # If the user just hits the enter key with no number, the program should exit. # Example: # Enter a number or just enter to guit: 45 # Enter a number or just enter to guit: 5 # Enter a number or just enter to quit: # The sum is: 50 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started