Is_int


#1

Im stuck on this level can you help?


3. is_int
#2

Thanks in Advance!!!


#3

Here's my code D:

def is_int(x):
    if x is int:
        return True
    else:
        return False

#4

https://www.codecademy.com/en/courses/python-intermediate-en-rCQKw/0/2?curriculum_id=4f89dab3d788890003000096
Here is the link as well :smiley:


#5

Oh ya, I rely on the forum to MUCH


#6

This question already exists. check out this link for some hints:


#8

But It doesn't matter if it exists its the Q & A forum so you can create your OWN questions... I'm not just gonna look for answers elsewhere.


#9

I used that topic and couldn't figure anything out. What was said in that topic was to complicated and I didn't understand it enough.


#11

Help me please :smiley: ...


#12

@jgiglio
Nevermind you were not helpful :anger: :anger: :anger:
I figured it out. hope you're happy now! :rage:


#13

I agree. The too cool for school attitude is unhelpful. A box of parts does not insure a mechanic talks to you. Teaching professionalism 101 is as important for the participants to demonstrate as the moderators. I came up with his answer but thought I must be nuts. If those who can't do teach, I find the converse is regrettably also true. There's a difference between off roading and disaster flick AND the difference might not be the attitude of the lead. Be kind professionalism is also kinda like always getting just jello molds at your potluck: grand total $2. Confused affronted and disappointed and 'I've known this person how long?'. The EQs have as much right to criticism as the IQs. Please stop and think. Keep trying. Coding is I'm finding as much about understanding why a guy who eats junk food suddenly cares about the price of carrots. Don't let the psychology defeat you.


#14

Don't forget to include absolute value.


#16

Thanks for the support it really got me out of my rage. :smiley:


#17

The guy (jgiglio) is helping other people... weird


#19

Not shut yet... :slight_smile:


#20

hello everyone,
(floats in python are actually doubles) can also be an integer (if it has nothing after the decimal point). I use the built-in is_integer() method on doubles to check this.

def is_int(x):

if float(x).is_integer():
    return True
else: 
    return False

print is_int(-3.4)


#21

That code doesn't work


#22

Do you need help with it?


#23

its working for me...!


#24

WEIIIRRRRDDDDD
Thats CRAZY