Jump to content

Very basic Python help

xGear
Go to solution Solved by LtStaffel,

3.4....really ***** me off as its sooooo simple and won't work lol, says there is a syntax error on SecondNumber

Ahah!  Found it, you need a second ) parentheses at the end of both variable declarations.

Why does this return syntax error? Very frustrating! Thanks.

Link to comment
Share on other sites

Link to post
Share on other sites

Why does this return syntax error? Very frustrating! Thanks.

Might want to post the code.

Link to comment
Share on other sites

Link to post
Share on other sites

FirstNumber = int(input ("Enter first number")

SecondNumber = int(input ("Enter second number")

                   

If FirstNumber > SecondNumber:

    print (FirstNumber)

else: 

    print (SecondNumber)

 

stupid website didnt upload it!

Link to comment
Share on other sites

Link to post
Share on other sites

 

FirstNumber = int(input ("Enter first number"))
SecondNumber = int(input ("Enter second number"))
                   
If FirstNumber > SecondNumber:
    print (FirstNumber)
else: 
    print (SecondNumber)
 
stupid website didnt upload it!

 

You missed some stuff. I make the same error pretty much every time I use int(input()) xD

 

EDIT: @xGear you should follow your own threads.

USEFUL LINKS:

PSU Tier List F@H stats

Link to comment
Share on other sites

Link to post
Share on other sites

wheres you variables?

FirstNumber = int(input ("Enter first number"))
SecondNumber = int(input ("Enter second number"))
Link to comment
Share on other sites

Link to post
Share on other sites

You missed some stuff.

 

EDIT: @xGear you should follow your own threads.

why?

Link to comment
Share on other sites

Link to post
Share on other sites

 

FirstNumber = int(input ("Enter first number"))
SecondNumber = int(input ("Enter second number"))

 

apologizes i use c++, Turbo Pascal, HTML. Not used to pythan. If you can wait a few mins im installing it now and will take a look for you :)

Link to comment
Share on other sites

Link to post
Share on other sites

apologizes i use c++, Turbo Pascal, HTML. Not used to pythan. If you can wait a few mins im installing it now and will take a look for you :)

Wow no need for that trouble, thanks lol

Link to comment
Share on other sites

Link to post
Share on other sites

Are you in python 3.4 or 2.7?

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

You should follow them so you don't miss what people are saying, it's just generally useful.

oh ok thanks

Link to comment
Share on other sites

Link to post
Share on other sites

Are you in python 3.4 or 2.7?

3.4....really ***** me off as its sooooo simple and won't work lol, says there is a syntax error on SecondNumber

Link to comment
Share on other sites

Link to post
Share on other sites

3.4....really ***** me off as its sooooo simple and won't work lol, says there is a syntax error on SecondNumber

Ahah!  Found it, you need a second ) parentheses at the end of both variable declarations.

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

I am unable to test if any solutions work as I can't go on my computer now :(

Link to comment
Share on other sites

Link to post
Share on other sites

Ahah!  Found it, you need a second ) parentheses at the end of both variable declarations.

Of course!!!! Thank you soooo much! This is also why I prefer VB so much as that would just autocorrect it!

Link to comment
Share on other sites

Link to post
Share on other sites

Ahah!  Found it, you need a second ) parentheses at the end of both variable declarations.

dam beat me to it xD

 

I am unable to test if any solutions work as I can't go on my computer now :(

LtSaffel's right 

Link to comment
Share on other sites

Link to post
Share on other sites

Of course!!!! Thank you soooo much! This is also why I prefer VB so much as that would just autocorrect it!

I highly recommend Pycharm by Jetbrains

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

Of course!!!! Thank you soooo much! This is also why I prefer VB so much as that would just autocorrect it!

why are you using python if you also use VB? 

Link to comment
Share on other sites

Link to post
Share on other sites

Ahah!  Found it, you need a second ) parentheses at the end of both variable declarations.

Oh wait a second, there's already two on the end, isn't that right?

Link to comment
Share on other sites

Link to post
Share on other sites

Oh wait a second, there's already two on the end, isn't that right?

There aren't two at the end of when you declare either of the variables

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

why are you using python if you also use VB?

I have to use Python, darn assignments!

Link to comment
Share on other sites

Link to post
Share on other sites

I highly recommend Pycharm by Jetbrains

What's that?

Link to comment
Share on other sites

Link to post
Share on other sites

What's that?

A Python IDE, it'll tell you when you have incorrect syntax, it can predict what you are going to right, it organizes your projects, it pretty much helps with ever part of the process.

Join the Appleitionist cause! See spoiler below for answers to common questions that shouldn't be common!

Spoiler

Q: Do I have a virus?!
A: If you didn't click a sketchy email, haven't left your computer physically open to attack, haven't downloaded anything sketchy/free, know that your software hasn't been exploited in a new hack, then the answer is: probably not.

 

Q: What email/VPN should I use?
A: Proton mail and VPN are the best for email and VPNs respectively. (They're free in a good way)

 

Q: How can I stay anonymous on the (deep/dark) webzz???....

A: By learning how to de-anonymize everyone else; if you can do that, then you know what to do for yourself.

 

Q: What Linux distro is best for x y z?

A: Lubuntu for things with little processing power, Ubuntu for normal PCs, and if you need to do anything else then it's best if you do the research yourself.

 

Q: Why is my Linux giving me x y z error?

A: Have you not googled it? Are you sure StackOverflow doesn't have an answer? Does the error tell you what's wrong? If the answer is no to all of those, message me.

 

Link to comment
Share on other sites

Link to post
Share on other sites

A Python IDE, it'll tell you when you have incorrect syntax, it can predict what you are going to right, it organizes your projects, it pretty much helps with ever part of the process.

Ah sweet will have to try it, thanks for your help!

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×