generated from mwc/lab_names
Hello! It takes a little longer than the first lab to understand how everything goes, but still it's easy to figure out. I could not print the area of the circle at first cause I had put it inbetween quotations... ofc then it just printed "circle_area" lol. So then I looked back at the other examples from the lab and figured out my mistake. All in all I understand it but it is less intuitive than the previous lab. Maybe also because there is less of a clear goal? I am just following the instructions. But I guess that is always gonna be the case when getting introduced to the basics of a new skill. Btw, I could not submit any text during the adventure lab but I really liked it as a game, cause it was very vividly described and also it really teaches you the commands well. I am now using tabs all the time!! and cd .. (whereas previously I had to exit the terminal and find my way back to the right folder, which is way too timeconsuming). Anyway, I am really enjoying these lessons. I don't know how I would teach it to students (thank god im just teaching myself - with your help!).
11 lines
243 B
Python
11 lines
243 B
Python
# circle_area.py
|
|
# --------------
|
|
# By MWC Contributors
|
|
|
|
print("This program will calculate the area of a circle.")
|
|
radius = float(input("What is the circle's radius? "))
|
|
pi = 3.141592653
|
|
circle_area = pi * radius * radius
|
|
print(circle_area)
|
|
|