我試圖檢查第三命令行是一個數字,所以我做 int n;
if (!isdigit(argv[3]))
{
fprintf(stderr, "n MUST be a number");
return 4;
} else
{
n = atoi(argv[3]);
printf("%i\n",n);
}
,但我
employee = float(raw_input('Employee code number or 0 for guest:') or 0.0)
if employee == isalpha:
print "Nice try buddy"
print "Welcome BIG_OLD_BUDDY"
此代碼不識別字母輸入。
a = 3.50
print"Price of Sandwich: $",a,
print""
Jeff =(raw_input('Enter how many of this item:')or 0.0)
if(Jeff.isalpha()):
Jeff == 0
a = (Jeff * a)
print'Total: $'+ str(a)
print''
我需要按字
這是爲什麼函數1執行但函數2返回錯誤? (Python的3.4) 功能1: secret('abc123')
功能2: secret('123')
代碼: def secret(s):
i = 0
result = ''
while s[i].isdigit():
result = result + s[i]
i = i + 1
return result
import java.util.Scanner;
public class testing
{
public static void main(String[] args)
{
Scanner stdIn = new Scanner(System.in);
System.out.println("Please enter a string of