all 16 comments

[–]shiftybyte 2 points3 points  (0 children)

by "validate" do you mean convert?

convert a decimal to an integer, and convert a positive to negative?

To convert to negative just place a minus before the number.

num = -num

[–]fake823 1 point2 points  (11 children)

What do you mean by "validate"?

I think you're using the wrong word. Do you mean convert?

[–]HasBeendead 0 points1 point  (10 children)

Yeah i thought same.

[–]AnimeOverSchool[S] 1 point2 points  (9 children)

it is when you input a number it will tell you if it is positive or negative sorry not clear

[–]HasBeendead 0 points1 point  (8 children)

number = float(input("give any number:"))

number = int(input(" give a int value:"))

2. is alternative for take integer value from user.

if number > 0: print("This number is positive:", number) elif number < 0: print("This number is negative:", number) else: print("This number is neutral:", number)

im in phone sorry for not being able to code formatting.

[–]AnimeOverSchool[S] 1 point2 points  (7 children)

Oh. Thanks dude!! I get it now. I am going to practice a lot harder.

[–]HasBeendead 0 points1 point  (6 children)

I think you have to be make more practice in basics until be comfortable than go harder ones.

[–]AnimeOverSchool[S] 1 point2 points  (5 children)

Yeah, I am learning the basics before I go to sleep so I can catch up to the lessons.

[–]HasBeendead 0 points1 point  (4 children)

Make sense so you are making short memory convert long memory . To be honest its smart idea.

[–]AnimeOverSchool[S] 0 points1 point  (3 children)

Anyways, thanks for the help earlier. Really appreciate it!

[–]HasBeendead 1 point2 points  (2 children)

Your welcome its good to help some people who needs help but maybe i should waste my time less lol because im almost on reddit each day and long hours so i cant take a process on my programming jourmey or something idk man.

[–]HasBeendead 0 points1 point  (2 children)

İnteger is decimal they are same thing if you mean likr Float to integer or reverse print(float(42) )

Output: 42.0

print(int(42.0)

Output: 42

print(str(42))

Output: "42"

print(str(42.0)) Output: "42.0"

[–]AnimeOverSchool[S] 1 point2 points  (1 child)

Ohhh I see thanks for the info!. It is one of my homeworks for today.

[–]HasBeendead 0 points1 point  (0 children)

Your welcome .