Comparison between the first Python program and shell
Read
Recently, I started to learn python and compare it with the shell: Shell:
zero
one
two
three
four
five
six
seven
eight
nine
ten
#!/bin/bash
# Author:Byrd
# Version:0.1
# Site:note.t4x.org
# Contact:root#t4x.org
a=one hundred
if[$a-gezero];then
echo$a
else
echo"-$a"
fi
Note: - gt means greater than or equal to. Please man test for details Python
zero
one
two
three
four
five
six
seven
#!/usr/bin/env python
# Author: Byrd
# Created Time: Tue 20 Dec 2016 02:20:07 PM CST
a=one hundred
ifa>=zero:
print(a)
else:
print(-a)
Note: When the statement:At the end, indented statements are treated as code blocksSourceByrd's Weblog-https://note.t4x.org/code/first-python-diff-shell/
Statement: unless otherwise specifiedByrd's BlogThe content is original. Reproduction without permission is prohibited!For details, please readCopyright Statement!