[Tutor] Python Help (shits killing me)

2018-10-26 Thread Ben Placella
So I have to make a fibonacci sequence, and I'm not sure what is wrong with
my code
#This program illustrates the fibonacci sequence
nterms=int(input("Please enter how many terms you would like to know: "))
n1 = 1
n2 = 1
count = 0
if nterms <= 0:
print("Please enter a positive integer")
elif nterms == 1:
print("Fibonacci sequence upto",nterms,":")
print(n1)
else:
print("Fibonacci sequence upto",nterms,":")
while count < nterms:
print(n1,end=' , ')
nth = n1 + n
n1 = n2
n2 = nth
count += 1

attached is a photo of what the output SHOULD look like
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor


[Tutor] Python Help

2018-10-26 Thread Ben Placella
I need to write code that runs a  cost calculating program with many
different variables and I honestly don't understand it, my code is:
beefmeals=int(input("Enter number of beef meals: "))
shitmeals=int(input("Enter number of vegan meals: "))
party=beefmeals+shitmeals
print(party)
if party<=50
a=75
print("Room cost $75")
elif party <=150
b=150
print("Room cost $150")
else
c=250
print("Room cost $250")
roomtax=party*0.065
print(roomtax)
print("Beef Meals", beefmeals)
$beef=(beefmeals*15.95)
print($beef)
print("Beef cost", $$beef)
print("Vegan Meals", shitmeals)
$shit=(shitmeals*10.95)
print($shit)
cost=($beef+$shit)
grat=cost*0.18)
print(grat)
GT=(grat+$beef+$shit+(a,b,c))
print(GT)

This is what the output is supposed to be:
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor