Skip to content

Instantly share code, notes, and snippets.

@DuncantheeDuncan
Created September 11, 2019 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DuncantheeDuncan/167d25cb1883077aade4af13e459ada7 to your computer and use it in GitHub Desktop.
Save DuncantheeDuncan/167d25cb1883077aade4af13e459ada7 to your computer and use it in GitHub Desktop.
space = "\n"
# this program counts the number of floats numbers that are greater than 25.0
# and returns a string.
floatone =float(input("Enter the First float number: "))
floattwo =float(input("Enter the Second float number: "))
floatthree =float(input("Enter the Third float number: "))
floatfour =float(input("Enter the Fourth float number: "))
floatfive =float(input("Enter the Fifth float number: "))
print space
lists = [floatone,floattwo,floatthree,floatfour,floatfive]
for display in lists:
print "this is the enterd number %.3f " %display
print space
for x in lists:
if(x > 25.5):
nuw = [x]
nuw.append(x)
print "Found ",len(nuw),"numbers that are greater than 25.5 "
break
else:
print "No number that is grater than 25.5 was enterd"
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment