Jump to content

Whats wrong with this code?

Overkilled

Python 3 code I'm just started learning to code and I've got the booklet

post-196573-0-21279500-1442950308_thumb.

Link to comment
Share on other sites

Link to post
Share on other sites

is this ok?

 

Shouldn't you know? The calculations look correct to me unless you're area calculation is supposed to be for the entire surface area in which case it's wrong.

 

One thing I'd recommend is that you choose better variable names. Example:

  • 'r' for radius instead of 'a'
  • 'h' for height instead of 'b'
  • 'v' for volume instead of 'c'
  • 'a' for area instead of 'f'
Link to comment
Share on other sites

Link to post
Share on other sites

<p>Shouldn't you know? The calculations look correct to me unless you're area calculation is supposed to be for the entire surface area in which case it's wrong. One thing I'd recommend is that you choose better variable names. Example:

  • 'r' for radius instead of 'a'
  • 'h' for height instead of 'b'
  • 'v' for volume instead of 'c'
  • 'a' for area instead of 'f'
  

You can only have 1 a integer

  

You made two 'a's instead of an 'a' and a 'b'.

Any idea why this isn't working?What it should do:Enter letter: T

Enter number: 6

TTTTTT

Mine

post-196573-0-48464800-1442960581_thumb.

post-196573-0-64112500-1442960637_thumb.

Link to comment
Share on other sites

Link to post
Share on other sites

?

You're using the name 'L' twice.

 

edit: You also don't need a loop for this. Doing L * N will repeat the string L, N times.

1474412270.2748842

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×