# Computing A level help - Urgent

Watch
Announcements
#1
Ok so far I've done this

# ------------------------------------------------------------
# Global variables
# ------------------------------------------------------------
count = 1
number = 1

# ------------------------------------------------------------
# Main program
# ------------------------------------------------------------
number = int (input ("Enter a number 1 to 12: "))

# =====> Complete the brackets
if ( number<1):
print ("Number is too small")
# =====> Complete the brackets
elif (number > 1):
print ("Number is too large")
else:
# =====> Complete the brackets
while ( ):
print (str(number) + " x " + str(count) + " = " + str(count * number))
# =====> Add a line to keep the loop going around

Any help would be sooooo appreciated!!!

I've attached the question : )
Last edited by Geoarge_Whright; 1 month ago
0
1 month ago
#2
(Original post by Geoarge_Whright)
Ok so far I've done this

# ------------------------------------------------------------
# Global variables
# ------------------------------------------------------------
count = 1
number = 1

# ------------------------------------------------------------
# Main program
# ------------------------------------------------------------
number = int (input ("Enter a number 1 to 12: "))

# =====> Complete the brackets
if ( number<1):
print ("Number is too small")
# =====> Complete the brackets
elif (number > 1):
print ("Number is too large")
else:
# =====> Complete the brackets
while ( ):
print (str(number) + " x " + str(count) + " = " + str(count * number))
# =====> Add a line to keep the loop going around

Any help would be sooooo appreciated!!!

I've attached the question : )
Which part are you struggling with here?
0
#3
(Original post by Upthefilm)
Which part are you struggling with here?
Hi!

uhm the process of the question tbh

Is this part right?

if ( number<1):
print ("Number is too small")
# =====> Complete the brackets
elif (number > 1):
print ("Number is too large")
else:
0
1 month ago
#4
(Original post by Geoarge_Whright)
Hi!

uhm the process of the question tbh

Is this part right?

if ( number<1):
print ("Number is too small")
# =====> Complete the brackets
elif (number > 1):
print ("Number is too large")
else:
First statement seems fine. For your second if statement , you are saying that any number greater than 1 is too large to enter, refer back to the question to see what range of numbers can be entered.
1
1 month ago
#5
(Original post by Geoarge_Whright)
Ok so far I've done this

# ------------------------------------------------------------
# Global variables
# ------------------------------------------------------------
count = 1
number = 1

# ------------------------------------------------------------
# Main program
# ------------------------------------------------------------
number = int (input ("Enter a number 1 to 12: "))

# =====> Complete the brackets
if ( number<1):
print ("Number is too small")
# =====> Complete the brackets
elif (number > 1):
print ("Number is too large")
else:
# =====> Complete the brackets
while ( ):
print (str(number) + " x " + str(count) + " = " + str(count * number))
# =====> Add a line to keep the loop going around

Any help would be sooooo appreciated!!!

I've attached the question : )
Good start, and you're partially right.

First bracket (number < 1) is correct. Any number below 1 is too small.

For the second bracket you've put (number > 1). That's not correct. If you entered 2, the program would tell you that's too large

Have you got any thoughts on the third bracket (the while loop) and the line you need to add to keep the loop going? These two are related, so you might not get the line to add until you've got the while loop
1
#6
(Original post by Acsel)
Good start, and you're partially right.

First bracket (number < 1) is correct. Any number below 1 is too small.

For the second bracket you've put (number > 1). That's not correct. If you entered 2, the program would tell you that's too large

Have you got any thoughts on the third bracket (the while loop) and the line you need to add to keep the loop going? These two are related, so you might not get the line to add until you've got the while loop
Ah yes I see now. the second bracket should be number>12

Not too sure on the while loop though
0
#7
(Original post by Upthefilm)
First statement seems fine. For your second if statement , you are saying that any number greater than 1 is too large to enter, refer back to the question to see what range of numbers can be entered.
Ah yes I see now. the second bracket should be number>12

Not too sure on the while loop though
0
#8
(Original post by Upthefilm)
First statement seems fine. For your second if statement , you are saying that any number greater than 1 is too large to enter, refer back to the question to see what range of numbers can be entered.
Is the while part number?
0
1 month ago
#9
(Original post by Geoarge_Whright)
Ah yes I see now. the second bracket should be number>12

Not too sure on the while loop though
No worries,
Now Inside those brackets they are looking for a condition to placed in them so that the print statement will run a certain amount of times (look at the example they give). They have given a variable for you to use, you must think about how many times do I want this print statement to run and how can i ensure that it won't run more than necessary by using this variable.

The line they require you too write is so that the condition you make in the while loop can be met, in this case it will be updating a variable.

not sure how much help this was so let me know if you require anymore help
0
1 month ago
#10
(Original post by Geoarge_Whright)
Ah yes I see now. the second bracket should be number>12

Not too sure on the while loop though
Correct.

For the while loop, see what Upthefilm wrote above
0
X

new posts
Back
to top
Latest
My Feed

### Oops, nobody has postedin the last few hours.

Why not re-start the conversation?

see more

### See more of what you like onThe Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

### Poll

Join the discussion

#### Are you tempted to change your firm university choice on A-level results day?

Yes, I'll try and go to a uni higher up the league tables (42)
27.1%
Yes, there is a uni that I prefer and I'll fit in better (14)
9.03%
No I am happy with my choice (88)
56.77%
I'm using Clearing when I have my exam results (11)
7.1%