You are Here: Home

# A452 watch

1. how do you make this code work in python?
input
def mystery(n):
a, b = 0, 1
while a < n:
print (a)
a, b = b, a + b
2. (Original post by noahBigG)
how do you make this code work in python?
input
def mystery(n):
a, b = 0, 1
while a < n:
print (a)
a, b = b, a + b
I'm not entirely sure what you're trying to do. Is the user entering a number into n?

Posted from TSR Mobile
3. (Original post by Andy98)
I'm not entirely sure what you're trying to do. Is the user entering a number into n?

Posted from TSR Mobile
yeah but it just highlights the new value and displays invalid syntax
4. (Original post by noahBigG)
how do you make this code work in python?
input
def mystery(n):
a, b = 0, 1
while a < n:
print (a)
a, b = b, a + b
YO MAH NIGGY! Just make the shell run fib. Just literally run fib (10) underneath
5. (Original post by noahBigG)
yeah but it just highlights the new value and displays invalid syntax
Well with python to set n = to a user input I'd recommend something like:

Print("enter a number")
n=raw_input

Posted from TSR Mobile
6. (Original post by Andy98)
Well with python to set n = to a user input I'd recommend something like:

Print("enter a number")
n=raw_input

Posted from TSR Mobile
cheers bruh
7. can somebody show me how to do a flow chart for the code :
def mystery(n):
a, b = 0, 1
while a < n:
print (a)
a, b = b, a + b
8. mystery(n)
n=any number
def mystery(n):
a, b = 0, 1
while a < n:
nprint (a)
a, b = b, a + b
mystery(10)
9. loll I did this controlled assessment last month! It was soooooo long.
Good luck to you guys!

TSR Support Team

We have a brilliant team of more than 60 Support Team members looking after discussions on The Student Room, helping to make it a fun, safe and useful place to hang out.

This forum is supported by:
Updated: February 9, 2016
Today on TSR

### Tuition fees under review

Would you pay less for a humanities degree?

### Buying condoms for the first time - help!

Discussions on TSR

• Latest
Poll
Useful resources

Can you help? Study Help unanswered threadsStudy Help rules and posting guidelines

## Groups associated with this forum:

View associated groups
Discussions on TSR

• Latest

The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE