Home Work Assignment

+2 Sunday Akinduro · January 23, 2015
for i in range(4, 100, 4):

print (i)

Post a Reply

Replies

- page 1
Oldest  Newest  Rating
+1 Sunday Akinduro · February 5, 2015
Hi Bernard,

It was my solution to the Home Work Assignment that Bucky gave us in the Video. Thanks
+1 rachel laran · February 5, 2015
@Bernard...u aint got yourself, naughty pal, wish i had the priviledge on this site to knock u on the head! lol...thats gonna be awesome, welll im trying lil bits of python programming...and @Sunday Akinduro, i can help when u have pythonic issues
+1 rachel laran · February 2, 2015
Nope it doesn't mean or need for you to have the variable i declared before hand..it is a dynamical declaration, that is the variable i is declared on the run and exectution of your program, even u can change the stuff to

    for  me in range(20):
          print  me

what this is insinuating is that you are assigning the iterable in the range(20) to the value me as the loop goes on
0 Sunday Akinduro · February 7, 2015
Thanks Nishant,

But I could only see part of the code you posted in your reply.
0 Sunday Akinduro · March 28, 2015
@Nishant Kumar Thakur, thanks for your input and time.
0 Bernard Pyc0d333 Parah · February 5, 2015
ouch sorry
0 Bernard Pyc0d333 Parah · February 5, 2015
and Rachel is a python geek, so she can always help out.
0 jefferson cabrera · February 2, 2015
He did:


for i in range(4, 100, 4):

print (i)

is it possible he gave the variable i a value? beforehand?
0 Bernard Pyc0d333 Parah · February 5, 2015
haha, you gotta become a moderator to do that, if i we had crowns, you would be the PYTHON QUEEN.
:)
0 Sunday Akinduro · February 5, 2015
Hi Rachel,

Can you please help me with the solution to the pythonic issue below.

Please I need help. I am a starter.

I defined the function below and it works for its purpose. I attempted to bind the function with the layout I created but I am not getting the desired result.

I would like that the user enter the parameters of the function in the Entry field created in the GUI and by clicking the Monthly Tax Payable button, the user will see the result.

Thanks in advance for your help.


from tkinter import *

root = Tk()
root.title('Paye Calculator')
frame = Frame(root)
frame.grid()


def calculate_paye(gross_pay, pension, life_assur):
    annual_tax_payable = (12 * float(gross_pay)) - (
        200000 + (0.2 * 12 * float(gross_pay)) + (12 * float(pension + life_assur)))
    if annual_tax_payable
  • 1
  • 2

Python

107,052 followers
About

This section is all about snakes! Just kidding.

Links
Moderators
Bucky Roberts Administrator