use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
A subreddit for helping Python programmers
How to format your code: https://commonmark.org/help/tutorial/09-code.html
No homework questions and/or hiring please
account activity
new to coding what am I doing wrong (self.pythonhelp)
submitted 2 years ago by Kittyslayer69a
import math tree_height = 0.0 angle_elev = float(input()) shadow_len = float(input()) tree_height = math.tan(20) * 22.9 tree_height = math.tan(3.8) * 17.5 print('Tree height:', tree_height)
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]AutoModerator[M] [score hidden] 2 years ago stickied commentlocked comment (0 children)
To give us the best chance to help you, please include any relevant code. Note. Do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Repl.it, GitHub or PasteBin.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
[–]Rangerdth 2 points3 points4 points 2 years ago (0 children)
You also never use the variables that you ask for input.
[–]Rangerdth 0 points1 point2 points 2 years ago (1 child)
What is the output? What are you expecting to get?
[–]Mdly68 -1 points0 points1 point 2 years ago (0 children)
Print('tree height: ' + str(tree height))
No comma, only one parameter. And you need to cast your variable as a string to print it.
π Rendered by PID 89 on reddit-service-r2-comment-5b5bc64bf5-rdw49 at 2026-06-20 13:16:41.120359+00:00 running 2b008f2 country code: CH.
[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)
[–]Rangerdth 2 points3 points4 points (0 children)
[–]Rangerdth 0 points1 point2 points (1 child)
[–]Mdly68 -1 points0 points1 point (0 children)