Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Fix This Python Code ! - Add Hungarian or Camel Notation - Fix Calling To Print Function -For The TwoPower Function the range needs to
Fix This Python Code !
- Add Hungarian or Camel Notation
- Fix Calling To Print Function
-For The TwoPower Function the range needs to be changed to (1,17), 2 to the power of zero should be 1
- Any additional advise or help would be very appreciated thank you!
1 /usr/bin/python 2 coding: utf-8 3 #Global 4 Su 0 5 value 1 7 fact 1 9 Define's Sum of Even Numbers 10 def SumofEvenNumbers 11 Sum 0 12 13 14 This Function Sets The Range Numbers For The Previous Function To Utilize 15 for i in range (0, 11 if i 2 0: 16 sum sum +i 17 print sum of even numbers is sum 18 19 20 This Function Defines Two Powers and Their Value 21 def Two Powers 22 value 1 23 24 25 This Function Sets The Range Numbers For The Previous Function To Utilize 26 for i in range(1, 17 value value 2 27 28 #Power Values 29 if value 0: value 1 30 31 print '2 0 value 32 print "2 i, 3', value 33 34 Set's Factorial Information For Program 35 def Factorial 36 fact 1 37 38 39 40 41 for i in range (1, 11 if i 1: 42 print i, k 43 44 else 45 46 while n i: fact fact n 47 48 n 49 print i fact 50 fact 1 51 52 SumofEvenNumbers 53 Two Powers 54 Factorial() 55Step 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