Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use python 3 to let those programs return None when an invalid input appear Question 6. If the input is not a float, let it
Use python 3 to let those programs return None when an invalid input appear Question 6. If the input is not a float, let it return zero def problem six(radius): return 3.14159 * radius * radius Question 7. If the input is not a string, let it return zero- def problem seven(file name: import ose f = open(file name."w"); name = input("Enter your name :") fwrite(name) f.close print(" Name is written to the file and closed successfully!") f = open(file name."1") new name = freado f.closed as.remove(file.name) print(" Name is read from file and file is Deleted successfully!") return new name Question 8. If the input is not a string & char, let it return zero def problem eight(test string, test char): ans = 14 for in test string: if is test char: ans = ans +1 return anse for i in test string: if is not test char: ans = 04 return ansa Question 9. If the input is not nothing, let it return zero def problem nine(: import sys return sys:version Question 10. If the input is not a list, let it return zero def problem ten email list): problem ten = [] for email in email list: index = email.find('@')+1 dem.ext = email[index:]+ if dom ext not in problem ten: problem ten.append(dom ext) return problem ten
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