You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
defgreetings (name='Peter'):
message=name+', welcome to Python for Everyone!'returnmessageprint(greetings())
print(greetings('Asabeneh'))
defgenerate_full_name (first_name='Asabeneh', last_name='Yetayeh'):
space=' 'full_name=first_name+space+last_namereturnfull_nameprint(generate_full_name())
print(generate_full_name('David','Smith'))
defcalculate_age (birth_year,current_year=2021):
age=current_year-birth_yearreturnage;
print('Age: ', calculate_age(1821))
defweight_of_object (mass, gravity=9.81):
weight=str(mass*gravity)+' N'# the value has to be changed to string firstreturnweightprint('Weight of an object in Newtons: ', weight_of_object(100)) # 9.81 - average gravity on Earth's surfaceprint('Weight of an object in Newtons: ', weight_of_object(100, 1.62)) # gravity on the surface of the Moon
By the way,
LiveCodes also supports JS, TS, React, SQL and many more, in case you want to also use it for 30-Days-Of-JavaScript, 30-Days-Of-React, 30-Days-Of-SQL, 30-Days-Of-HTML, 30DaysOfTypeScript, etc
By the way, LiveCodes also supports JS, TS, React, SQL and many more, in case you want to also use it for 30-Days-Of-JavaScript, 30-Days-Of-React, 30-Days-Of-SQL, 30-Days-Of-HTML, 30DaysOfTypeScript, etc
Great work. Thank you.
I suggest adding links to run code samples in an online playground where users can run the code, edit it, save for later and share with others, etc.
This are some examples:
Run in playground
Run in playground
Run in playground
Run in playground
If you are interested, I can start a PR to add links for running code snippets in the playground.
This playground is LiveCodes, a feature-rich, open-source, client-side code playground that supports 80+ languages/frameworks. The playground can be shared, exported (e.g. to GitHub gists), deployed (to GitHub Pages) and embedded in web pages using a powerful SDK.
LiveCodes runs completely on the client-side (with no backend). It uses Brython or Pyodide to run Python in the browser.
App: https://livecodes.io/
Docs: https://livecodes.io/docs/
GitHub repo: https://github.com/live-codes/livecodes
Disclosure: I'm the author of LiveCodes.
The text was updated successfully, but these errors were encountered: