junking 455
Posts 659
Rep 60
Vouches: 10
Credits: 763
Bronze MedalSilver MedalJukeboxMigrationGold MedalHalloweenGiftChocolate BunnyPalm Tree
Offline
OP09-20-2017, 04:32 PM
#1

(This post was last modified: 05-21-2019, 09:18 PM by Trust_.)
junking.



I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)
Liked by: nick
Posts 3,750
Rep 712
Vouches: 125
Credits: 8,723
Gold MedalChocolate BunnyPalm TreeBronze CoinSunDemonCandy CaneGiftApolloSilver MedalBronze MedalActiveHeartJukeboxGiftVoidHalloweenGrenade
Offline
09-20-2017, 04:36 PM
#2
maybe you need another code for the floating answer



Social Media Panel

KIK: nxk
DISCORD: NICK#5000
TELEGRAM: rubber


Social Media Panel

KIK: nxk
DISCORD: NICK#5000
TELEGRAM: rubber


Social Media Panel

KIK: nxk
DISCORD: NICK#5000
TELEGRAM: rubber


Social Media Panel

KIK: nxk
DISCORD: NICK#5000
TELEGRAM: rubber
Posts 659
Rep 60
Vouches: 10
Credits: 763
Bronze MedalSilver MedalJukeboxMigrationGold MedalHalloweenGiftChocolate BunnyPalm Tree
Offline
OP09-20-2017, 04:39 PM
#3
(This post was last modified: 09-20-2017, 04:40 PM by Trust_.)
(09-20-2017, 04:36 PM)T Wrote:maybe you need another code for the floating answer

I tried making another If statement apart from the first If statement by removing the else and just adding the If, which says:

if userResponse == floatingPointAnswer:

    print "Did you forget about integer division in Python?" 

When I enter 32.5, "Too high!" and "Did you forget about integer division in Python?" both show up but I still can't figure out how to get rid of the "Too high!" part  Crying



I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)
Liked by: nick
Posts 659
Rep 60
Vouches: 10
Credits: 763
Bronze MedalSilver MedalJukeboxMigrationGold MedalHalloweenGiftChocolate BunnyPalm Tree
Offline
OP09-20-2017, 05:07 PM
#4
(09-20-2017, 04:54 PM)Means Wrote:send the whole code

i actually just figured it out !



I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)


I ONLY DO DEALS THROUGH KIK OR DISCORD. PM ME ON SITE TO CONFIRM IT'S ME.
Kik: 8v1
Discord: (idk I have to find the numbers and shit)
Liked by: nick
Posts 941
Rep 279
Red NinjaTwitterMigrationBronze MedalGold MedalSilver MedalHalloweenGiftVoid
Offline
09-20-2017, 05:12 PM
#5
(This post was last modified: 09-20-2017, 05:13 PM by innocentguy75.)
Code:
userResponse= requestNumber ( "Enter the value of the expression \n 11 + 7 * 7 / 2 - 3 " )
correctAnswer = 32
floatingPointAnswer = 32.5

 if userResponse != correctAnswer or floatingPointAnswer:

   if userResponse < correctAnswer:
     print "Too low!"
   elif userResponse != floatingPointAnswer && userResponse > correctAnswer:
     print "Too high!"
   elif userResponse == correctAnswer:
     print "Correct!"
 else:
   if userResponse == floatingPointAnswer:
     print "Did you forget about integer division in Python?"


Liked by: nick, Trust_
Posts 1,891
Vouches: 27
Credits: 54
HalloweenActiveBronze CoinGold CoinSilver CoinChocolate BunnyEaster BasketSilver NinjaMigrationGrenadeBronze MedalSilver MedalGold MedalJukeboxPalm TreeGift
Offline
09-20-2017, 05:13 PM
#6
(09-20-2017, 05:12 PM)evil Wrote:userResponse= requestNumber ( "Enter the value of the expression \n 11 + 7 * 7 / 2 - 3 " )
correctAnswer = 32
floatingPointAnswer = 32.5

 if userResponse != correctAnswer or floatingPointAnswer:

   if userResponse < correctAnswer:
     print "Too low!"
   elif userResponse != floatingPointAnswer && userResponse > correctAnswer:
     print "Too high!"
   elif userResponse == correctAnswer:
     print "Correct!"
 else:
   if userResponse == floatingPointAnswer:
     print "Did you forget about integer division in Python?"

dang!
nice work!



[Image: ezgif-4-97c796a08c.gif]


[Image: ezgif-4-97c796a08c.gif]


[Image: ezgif-4-97c796a08c.gif]


[Image: ezgif-4-97c796a08c.gif]
Liked by: nick
Posts 165
Rep 35
TwitterGiftBronze Medal
Offline
12-07-2017, 07:59 PM
#7
(This post was last modified: 12-07-2017, 08:00 PM by fem.)
(09-20-2017, 05:12 PM)evil Wrote:
Code:
userResponse= requestNumber ( "Enter the value of the expression \n 11 + 7 * 7 / 2 - 3 " )
correctAnswer = 32
floatingPointAnswer = 32.5

 if userResponse != correctAnswer or floatingPointAnswer:

   if userResponse < correctAnswer:
     print "Too low!"
   elif userResponse != floatingPointAnswer && userResponse > correctAnswer:
     print "Too high!"
   elif userResponse == correctAnswer:
     print "Correct!"
 else:
   if userResponse == floatingPointAnswer:
     print "Did you forget about integer division in Python?"

&& doesn't exist in python, use 'and' instead.
Also the floatingPointAnswer and correctAnswer are mergable

Example:
Code:
user_response = requestNumber(...)
answer = 32.5

if user_response < answer:
   print("Too low")
elif user_response > answer:
   print("Too high")
else:
   print("Correct!")
assuming requestNumber is something like
Code:
def requestNumber(qst):
   try:
            return float(input(qst))
   except ValueError:
            return False
it'd allow you to check
Code:
if not user_response: print("not a number")


Posts 3,750
Rep 712
Vouches: 125
Credits: 8,723
Gold MedalChocolate BunnyPalm TreeBronze CoinSunDemonCandy CaneGiftApolloSilver MedalBronze MedalActiveHeartJukeboxGiftVoidHalloweenGrenade
Offline
12-07-2017, 08:00 PM
#8
(12-07-2017, 07:59 PM)fem Wrote:&& doesn't exist in python, use 'and' instead.


also the floatingPointAnswer and correctAnswer are mergable

Example:
Code:
user_response = requestNumber(...)
answer = 32.5

if user_response < answer:
   print("Too low")
elif user_response > answer:
   print("Too high")
else:
   print("Correct!")
assuming requestNumber is something like
Code:
def requestNumber(qst):
   try:
            return float(input(qst))
   except ValueError:
            return False
it'd allow you to check

Code:
if not user_response: print("not a number")

this thread happened like 3 months ago



Social Media Panel

KIK: nxk
DISCORD: NICK#5000
TELEGRAM: rubber


Social Media Panel

KIK: nxk
DISCORD: NICK#5000
TELEGRAM: rubber


Social Media Panel

KIK: nxk
DISCORD: NICK#5000
TELEGRAM: rubber


Social Media Panel

KIK: nxk
DISCORD: NICK#5000
TELEGRAM: rubber
Posts 165
Rep 35
TwitterGiftBronze Medal
Offline
12-07-2017, 08:01 PM
#9
(This post was last modified: 12-07-2017, 08:02 PM by fem.)
(12-07-2017, 08:00 PM)Nick Wrote:this thread happened like 3 months ago

I posted on another of OP's threads about python help and looked through some of his older threads.
Just wanted to throw that out there, as the answer wouldn't compile.

Posts 4,923
Rep 375
Vouches: 48
Credits: 752
DonatorDonator IIDonator IIIBronze CoinSilver CoinGold CoinRichest
Offline
12-07-2017, 08:03 PM
#10
lol I could have helped if this was java



Always confirm onsite.
 discord: david#9810


Always confirm onsite.
 discord: david#9810


Always confirm onsite.
 discord: david#9810


Always confirm onsite.
 discord: david#9810


Users browsing this thread: 1 Guest(s)