python基礎 打卡task1

2021-10-08 10:08:54 字數 938 閱讀 9061

a =

1type

(a)b =

float

(a)#b = 1.0

type

(b)c =

1.5type

(c)d =

int(c)

# d = 1

type

(d)

(2)整型——布林型

a =

0type

(a)b =

bool

(a)type

(b)c = flase

type

(c)d =

int(c)

type

(d)

(3)浮點型——布林型

a =

1.5type

(a)b =

bool

(a)type

(b)c =

true

type

(c)d =

float

(c)type

(d)

給定乙個非空整數陣列,除了某個元素只出現一次以外,其餘每個元素均出現兩次。找出那個只出現了一次的元素。嘗試用位運算解決此題。

class

solution

:def

singlenumber

(self, nums: list[

int])-

>

int:

res =

0for num in nums:

res^

=num

return res

class

solution

return res;}}

;

python學習打卡 Task1

基礎知識 注釋模組 內建函式dir 及help pep8 在mac終端輸入python可進入cpython互動式直譯器,利用print函式向世界打招呼吧 print hello,world 執行結果 hello,world input函式用於接收使用者輸入,先將輸入儲存在變數中,然後列印這個變數 d...

統計學基礎打卡 task1

1 基本概念 統計學 收集 處理 分析 解釋資料並從中得出結論的科學。資料分析的方法可分為描述統計和推斷統計。2泊松分布 泊松分布 poisson distribution 台譯卜瓦松分布,是一種統計與概率學裡常見到的離散機率分布 discrete probability distribution ...

Python基礎知識 task1

一 環境搭建 1.anaconda環境配置 注意 此處的環境配置針對的是在安裝anaconda的過程中沒有勾選自動配置環境變數那項。上圖即為環境變數的配置,注意是前五項的更新 win10 2.anaconda的環境下配置python 3.直譯器 pycharm 的編譯 三 python基礎講解 1....