Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Python 3 What is wrong please fix my mistakes Exercise 7. Boolean Expressions Complete the following quizzes.py program by writing the missing expressions. The program
Python 3 What is wrong please fix my mistakes
Exercise 7. Boolean Expressions Complete the following quizzes.py program by writing the missing expressions. The program reads three quizzes grades from the command line, and check whether the users passed all the quizzes (passed_all), or failed some at least (failed_some): nl = int (sys.argv[1]) n2 = int (sys.argv[-]) n3 = int (sys.argv[]) passed_all = failed_some = Exercise 8. Leap Year Compose a program leap.py that takes a positive integer command line argument representing a year number and prints True if the year is leap and False otherwise. A leap year is a year divisible by 4 but not by 100, or is divisible by 400. You may not use nested if statements of if/elif/else statements. You can use boolean expression that evaluates to the correct true/false answer, or simple if / Else statement. Exercise 9. Separating Digits Write a program that allows a user to enter an integer, and separates it into individual digits, and prints the digits with three spaces between them. Exercise 10. Vowels in a String Write a program that counts the number of vowels existing in a specific string s. Assume that s is all lower case letters. A letter is a vowel if it is one of the following: a, e, o, i, u. Exercise 11. Square Root of a Number Write a program mysqrt.py that reads a float from the command line and computes/prints its square root. The algorithm for computing the square root of a positive number 'd' works as follows: given any estimate x of the square root, an improved estimate can be computed as (x + a/x)/2. Therefore your algorithm can start from an initial estimate (say a) and iterate until x2 is equal to a to within a small tolerance, say 10-7. > python mysqrt.py 10.0 3.162277665175675 exercise 8 In [26]; import sys # main function def main(): # get year year int(sys.argv[1]) #check if leap year or not if(yearX400 o or (year 4 year%100 = 0)): print (True) else: print(False) and # PROGRAN EXECUTION STARTS HERE main() File "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