GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python_Basics/python_programs/user_input_float.py at master · learnbyexample/Python_Basics

This repository was archived by the owner on Dec 29, 2020. It is now read-only.

Expand file tree

/

user_input_float.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
10 lines (7 loc) · 299 Bytes
/

user_input_float.py

Copy path

File metadata and controls

10 lines (7 loc) · 299 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/python3
usr_ip = input("Enter a floating point number: ")
# Need to explicitly convert input string to desired type
usr_num = float(usr_ip)
sqr_num = usr_num * usr_num
# Limit the number of digits after decimal points to 2
print("Square of entered number is: {0:.2f}".format(sqr_num))
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.