Linux下編寫腳本Shell和Python的區別

思路和算法能夠同樣,可是語法不同啊。例如求1+2+3+4+...,和超過10000止shell,c,python實現思路相似。一、shell實現while循環#!/bin/shsum=0i=0while [ $sum -lt 10000 ];do i=$(($i+1)); #or ((i++)); sum=$(($sum+$i)); #or ((sum=sum+i));doneecho $i,
相關文章
相關標籤/搜索