Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solved Practice / Python / Introduction / Python: Division #42

Merged
merged 1 commit into from
Mar 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Solved Practice / Python / Introduction / Python: Division
  • Loading branch information
formidablae committed Mar 27, 2022
commit 74d780198b912251e4ac08eece430d2b1b6e11c0
42 changes: 42 additions & 0 deletions Practice/Python/Introduction/Python_Division.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Task
# The provided code stub reads two integers, and, from STDIN.

# Add logic to print two lines. The first line should contain the result of integer division,
# a // b. The second line should contain the result of float division, a / b.

# No rounding or formatting is necessary.

# Example
# a = 3
# b = 5

# - The result of the integer division 3 // 5 = 0.
# - The result of the float division is 3 / 5 = 0.6.

# Print:
# 0
# 0.6

# Input Format
# The first line contains the first integer, a.
# The second line contains the second integer, b.

# Output Format
# Print the two lines as described above.

# Sample Input 0
# 4
# 3

# Sample Output 0
# 1
# 1.33333333333

def main():
a = int(input())
b = int(input())
print(a // b)
print(a / b)

if __name__ == '__main__':
main()