# integer stayNights = 2 print(f'How long will you stay? For {stayNights} nights.') # float Tips = 5.6 print(f'How much tip did you gave to the waiter? {Tips} bucks.') # string waiterName = 'Jason' print(f"What is the waiter's name? {waiterName}~ Nice waiter") # bool handsomeOrNot = True print(f"Is he handsome? {handsomeOrNot}! I couldn't agree more.")
birthday = 1213 print("My BD is " +str(birthday)) print(type(birthday)) high = 160.3 print(f"我的身高是{high}") print(type(high)) school = "China Medical University" print(f"I am study in {school} now") print(type(school)) graduate = True print(f"Are tou graduate now ? {graduate}") print(type(graduate))
交功課了: language_mastered = 4 # integer print(f"I have mastered {language_mastered} languages.") weight = 73.6 # float print(f"My current body weight is {weight} kg.") place = 'Tokyo' # string print(f"Place I have been to is {place}.") correct = True # boolean print(f"Is it June now? {correct}") print(type(correct))
age = 31 print("I am " + str (age) + " years old") print(type(age)) weight = 60.5 print(f"my weight is {weight} kg") print(type(weight)) name = 'Yin' print(f"my name is { name }") print(type(name)) is_home = True print(f"are you in home?{is_home}") print(type(is_home))
score = 86.1 subject = 1 go_to_class = True pet = 'lucky' print(f"this is subject {subject}") print(type(subject)) print(f"and I got score {score} in subject {subject}") print(type(score)) print(f"Do you go to the class? {go_to_class}") print(type(go_to_class)) print(f"And by the way my pet's name is {pet}") print(type(pet))
# integer 整數
day = 6
print(f"我這次韓國旅行去了 {day} 天")
print(type(day))
# float 浮點數
hour = 5.5
print(f"每天平均睡了 {hour} 小時")
print(type(hour))
# string 字串
place = '首爾'
print(f"這次去的地方是 {place} ")
print(type(place))
# boolean 布林值 # true, False
is_online = True
print(f"這趟旅行好玩嗎? {is_online} ")
print(type(is_online))
謝謝老師😄
HOMEWORK - DAY1
# integer 整數
score = 75
print(f"這次數學考{score}分")
print(type(score))
# float 浮點數
ave = 79.5
print(f"平均是{ave}分")
print(type(ave))
# string 字串
suject = "歷史"
print(f"這次最難的是{suject}")
print(type(suject))
# boolean 布林值
pass = True
print(f"這次段考有過嗎 ? {pass}")
print(type(pass))
謝謝老師 ! 教得很清楚~😍
# integer 整數
year = 5
print("我出社會工作" + str(year) + "年")
print(type(year))
# float 浮點數
kilometer = 33.3
print(f"我家距離公司{kilometer}公里")
print(type(kilometer))
# string 字串要加 '(文字)'
place = '日本'
print(f"我喜歡去{place}玩")
print(type(place))
# boolean 布林值 # True, False
is_online = True
print(f"我喜歡出國嗎 ? {is_online}")
print(type(is_online))
謝謝老師
不客氣
# integer 整數
time= 6
print(f"現在是早上{time}點")
print(type(time))
# float 浮點數
hour = 3.5
print(f"我只睡了{hour}小時")
print(type(hour))
# string 字串
do_somthing = '學習ptyhon'
print(f"睡不著所以起來{do_somthing}")
print(type(do_somthing))
# boolean 布林值 #true,false
awesome = True
print(f"我今天很棒嗎?{awesome}")
print(type(awesome))
---------------
謝謝老師 😊
老师这是今天的作业
#integer
grade=6
print(f"我今年{grade}年级了")
print(type(grade))
#float
hour=8.5
print(f"每天我都睡{hour}小时")
print(type(hour))
#strings
place='USA'
print(f"我在{place}上学")
print(type(place))
#boolean
test=True
print(f"这次benchmark我一定能拿100分。{test}")
print(type(test))
谢谢老师的讲解,很清晰
float浮点数 string字符串 boolean布林值 integer整数
Cat_name = "Jijun"
Weight = 7.7
age = 4
Cat_love_food = True
print(type(Cat_name))
print(type(Weight))
print(type(age))
print(type(Cat_love_food))
感謝老師
homework - Day 1
#interger整數
age = 18
print("Ich bin" + str(age)+"Jahre Alt")
print(type(age))
#float 浮點數
gpa=4.2
print(f"我的GPA{gpa}分")
print(type(gpa))
#string 字串
name='Nika'
print(f"我的名字是{name}")
print(type(name))
# boolean 布林值 #true / false
ist_ledig = True
print(f"單身嗎?{ist_ledig}")
print(type(ist_ledig))
謝謝老師 有轉換成德文^^
德文?你在德國學習嗎
@@CodeShiba 沒有 我在台灣學德文 現學現用
感謝老師的教學!
#integer 整數
tanks = 4
print(f"我在房間設了 {tanks} 個水族缸")
print(type(tanks))
#float 浮動數
light = 4.5
print(f"下午約能照射 {light} 個小時的陽光")
print(type(light))
#string 字串
plant = '水草'
print(f"看著這些 {plant} 冒著泡泡就很療癒")
print(type(plant))
#boolean 布林 true, false
growth_well = True
print(f"長的十分旺盛嗎? {growth_well} ")
print(type(growth_well))
food=50 #整數
print(f'總共 {food} 斤')
print(type(food))
passe=20.5 #float浮點數
print(f'總共 {passe} 組解碼')
print(type(passe))
plan='計畫' #字串(str) 為字串型態
print(f'請造句{plan}的例句')
print(type(plan))
Crime=False #布林直 #true、false
print(f'是否犯罪 {Crime} ')
print(type(Crime))
謝謝老師
# integer 整數
age = 27
print(f'今年是 {age} 了!!!')
# float 有點數
weigh = 63.6
print(f"#我的體重 {weigh} 分")
print(type(weigh))
# String 字串
name = 'Hinson'
print(f'我的名字是 {name}')
print(type(name))
# Boolean 布林值#True, False
here = True
print(f'我可以再努力一點嗎? {here}')
print(type(here))
感謝老師!
#integer 整數
order_dishes = 21
print("我點了" + str(order_dishes) + "道菜來吃")
print(f"我點了{order_dishes}道菜來吃")
print(type(order_dishes))
#float 浮點數
test_score = 83.2
print("我考試得到了" + str(test_score) + "分")
print(f"我考試的到了{test_score}分")
print(type(test_score))
#string字符
location = "Taipei"
print("我住在"+str(location) +"這裡")
print(f"我住在{location}這裡")
print(type(location))
#Boolean 布林值 #true, false
watchmovie = False
print(f"你有沒有在看電影?{watchmovie}")
print(type(watchmovie))
# integer 整數
year = 20
print(f"當中醫師 {year} 年")
print(type(year))
# float 浮點數
score = '360.5'
print(f"當年上榜分數 {score} 分")
print(type(score))
# string 字串
subject="國文"
print(f"什麼科目最難?{subject}")
print(type(subject))
# boolean布林值
yes=True
print (f"相信自己,就會成功嗎?{yes}")
print(type(yes))
當中醫師是我最終想達到人生目標!
#integer 整數
depth=25
print(f"今天下潛深度{depth}公尺")
print(type(depth))
#float 浮點數
min=50.4
print(f"今天下潛時間{min}分鐘")
print(type(min))
#string
test='scubadiving'
print(f"今天的潛水項目是{test}")
print(type(test))
#boolean 布林值
is_pass=True
is_fail=False
print(f"今天我的水肺潛水考試結果{is_pass}")
print(type(is_pass))
print(f"今天我的潛伴水肺潛水考試結果{is_fail}")
print(type(is_fail))
#integer 整數
money=500
print(f"燒肉價格{money})
print(type(money))
#float 浮點數
weight=50.5
print(f"我的體重是{weight}公斤‘’)
print(type(weight))
#string 字串
word=‘’燒肉‘’
print(f"我想吃{word}"}
print(type(word))
#boolean #true #false
want=True
print(f"晚上是否要吃?{want}")
print(type(want))
謝謝老師🎉(不過當初沒注意到True要大寫導致一直變成string😂)
# integer 整數
time= 8
print("我一个星期去"+ str(time)+"次健身房")
print(f"我一个星期去{time}次健身房")
print(type(time))
# float 浮点数
weight=88.8
print("我的体重是"+str(weight)+"kg")
print(f"我的体重是{weight}kg")
print(type(weight))
# string 字符
city="北京"
print("我的老家在"+city)
print(f"我的老家在{city}")
print(type(city))
# boolean 布林值 # true, false
sleep=False
print(f"你应该在{sleep}" )
print(type(sleep))
谢谢老师
謝謝老師教學影片~
# integer 整數
set = 3
print(f"今日我買周邊{set} 套")
print(type(set))
# float 浮點數
cost = 5.5
print(f"整套花了 {cost} 萬")
print(type(cost))
# string 字串
shop_name= '阿宅天地'
print(f"今日前往 {shop_name} ")
print(type(shop_name))
# boolean 布林值 # true, False
is_online = True
print(f"今日所購買的周邊喜歡嗎? {is_online} ")
print(type(is_online))
讚 加油!
作業:
#integer
pages = 50
print(f"這本書有{pages}頁")
print(type(pages))
#float
dollars = 999.99
print(f"這本書要{dollars}$USD")
print(type(dollars))
#string
shop_name = "開心書店"
print(f"上週我跟我的朋友一起去{shop_name}買的書")
print(type(shop_name))
#integer整數
hour=10
print(f"我每天上學{hour}小時")
#float
min=50
print(f"我今天花了{min}分鐘吃飯")
#string
food='拉麵'
print(f我最喜歡吃的食物是{food}"})
#布林值
is online=吃飽了
print(f'你吃飽了嗎?{is online}")謝謝老師
讚!繼續加油
numpeople = 10
print (f”我們一共{numpeople}個人“)
height = 1.8
print (f”這個角色的身高是{height}米”)
destination = “天空之城”
print (f”目的地 : {destination}”)
ysno = False
print (f”你喜歡工作嗎?{ysno}”)
感謝你的教學😊
不客氣
名字是 Ray
身高是 170cm,體重是80kg
體指率是 27.6
是否過胖 True
# integer 整數
day = 2
print(f"今天是減脂第{day}天")
print((type(day)))
# float 浮點數
weight = 85.3
print(f"今天體重是{weight}公斤")
print(type(weight))
# string 字串
place = 'world gym'
print(f"我都去{place}運動")
print(type(place))
# boolean 布林值
train = True
print(f"今天要重訓嗎?{train}")
print((type)(train))
謝謝老師
不知道為什麼沒辦法用老師教的方式寫string跟boolean
改成下面這樣句子就成形了
#homework
#integer
worktime=10
print('平均每天加班'+str(worktime)+'小時')
#float
weight=49.85
print('備賽期間體重'+str(weight)+'公斤')
#string
food='油燜苦瓜'
print('每次去清粥小菜都是為了吃'+(food))
#boolean
change_job=False
print('今年可不可以換工作?'+str(change_job))
你把寫錯的貼給我看看 除非你用的是python 2
@@CodeShiba 您好!謝謝回覆!
我後來發現是..我沒看到鍵盤上面的{},找到之後code就可以正常跑出來了...> <
#string
object_1='天才'
print(f"我真是個{object_1}")
object_2='{}'
print(f"我居然找不到鍵盤上的{object_2}")
interger 整數
day=4
print{f"我這次連假放(day)天"}
print{type(day)}
#float 浮點數
hour=6.5
print{f"我平均一天睡(hour)小時"}
print{type(hour)}
#string 字串
place=家裡蹲
print{f"我是在(place)"}
#boolyn #true false
is_online=ture
print{f"連假有充實嗎 is (true)"}
print type(is_oneline)
# integer 整數
day = 35
print (f”今天是學的第 {day} 天”)
print(type(day))
#float 浮點數
weight = 44.6
print(f”我的體重是 {weight} 公斤
print(type(weight))
# string
road = ’自由路‘
print(f”那家店在 {road} 上“)
print(type(road))
# Boolean # true, false
im_fine = true
print(f”你好嗎?{im_fine}”)
print(type(im_fine))
#integer
score = 90
print(f"我的分數是{score}")
print(type(score))
#float
hight = 1.6
print(f"我的身高是{hight}")
print(type(hight))
#string
weather = '晴天'
print(f"今天天氣是{weather}")
print(type(weather))
#boolean
mood = True
print(f"你今天開心嗎?{mood}")
print(type(mood))
謝謝老師~😆
# integer 整數
month = 7
print(f"現在是{month}月")
print(type(month))
# float 浮點數
minute = 4.5
print(f"你現在還有{minute}分鐘")
print(type(minute))
# string
topic = 'time'
print(f"這次報告主題是 {topic} ")
print(type(topic))
# boolean # ture, false
result = True
print(f"評估結果正常{result}")
print(type(result))
#integer 整數
day = 7
print("我去日本待了" + str(day) +"天")
print(type(day))
#float 浮點數
walktime = 6.5
print(f"我平均走路的時間{walktime}小時")
print(type(walktime))
#string
name = '大阪' + '京都'
print(f"我去了這些地方{name}")
print(type(name))
#boolean true or false
is_funny = True
print(f"這趟旅程好玩嘛?{is_funny}")
print(type(is_funny))
#integer
book=10
print(f"我读了{book}本书”)
print(type(book))
#float
time=5.2
print(f“我花了{time}小时读书”)
print(type(time))
#string
tittle=Little Prince
print(f“这本书的书名是(tittle)”)
print(type(tittle))
#boolean
review=true
print(f“这些书好看吗?(review)”)
print(type(review))
谢谢老师的教导!
code =5
print(f"這個金庫的最後一號是{code}")
# boolean 布林值
sd =True
print(f"你確定金庫密碼是{sd}嗎?")
# string 字串
name ='simon'
print(f"這是{name}的金庫嗎?")
# float 浮點數
id =6.6
print(f"他的gpa是{id}")
price=100
print(f"蛋糕價格是{price}元")
print(type(price))
slice=1.5
print(f"蛋糕切成{slice}塊")
print(type(slice))
name='草莓戚風蛋糕'
print(f"蛋糕名字是{name}")
print(type(name))
in_stock=True
print(f"蛋糕目前有貨嗎?{in_stock}")
print(type(in_stock))
謝謝老師!🐱
# integer 整數
people = 8
print(f”參加研討會{people}人”)
print(type(people))
# float 浮點數
percent = 5.6
print(f”股票下跌{percent} %)
print(type(percent))
# string 字串
prize = 電鍋
print(f”本次中獎商品為{prize})
print(type(prize))
# boolean 布林值 # true,false
married = true
print(f”已婚?{married})
print(type(married))
謝謝老師🌈
# float 浮點數
price = 975.0
print(f"台積電股價 {price} 元")
print(type(price))
# string
target = '兩萬五千點'
print(f"台股大盤指數月底目標 {target} ")
print(type(target))
#boolean # true, false
keep = True
print(f"是否守住季線?{keep}")
print(type(keep))
# integer 整數
number = 20
print(f"我的持股數"+str(number))
print(type(number))
謝謝老師細心講解,想請問一下pyton裡 {} 和 () 的差異處? f-string代表的意思是轉換成字串的意思是嗎?
是的
# integer 整數
population = 101
print('鯊鯊村人口數是' + str(population)+ '人')
# float 浮點數(有小數)
percentage = 0.72
print(f'可可亞含量 {percentage} 度')
print(type(percentage))
# string 字串
ikeastar = 'shark'
print(f"宜家大明星是 {ikeastar}")
print(type(ikeastar))
# boolean 布林值 # true, false
learning_python = True
print(f'妳在學python嗎? {learning_python}')
print(type(learning_python))
tmp = 15
print('現在溫度' + str(tmp))
生日 = 7.26
print(f"我的生日是 {生日} ")
print(type(生日))
county = 'Japan'
print(f"我的名字是{county} ")
print(type(county ))
are_you_happy= True
print(f"are_you_happy?{are_you_happy}")
print(type(are_you_happy))
感謝!
#integer 整數
year=5
print(f"我已工作{year}年")
print(type(year))
#float 浮點數
distance=5.2
print(f"家距離便利商店有{distance}公里遠")
print(type(distance))
#string 字串
country='Janpan'
print(f"我們的蜜月旅行是要去{country}"
print(type(country))
#boolean 布林值
typhoon_holiday=True
print(f"這次的颱風你們公司有放假嗎?{typhoon_holiday}")
print(type(typhoon_holiday))
4:46
line 10:print(f"my name is {name} ")
為什麼在print後面要加上f?
F-string那章節有講解呦
這個影片好像沒有說到好像被剪掉了@@CodeShiba
@@Minecraftnowgamer 搜尋一下 f-string 的章節(完整教學那版有)
@@CodeShiba 有看到了謝謝
#interger
quantity=10
print("我拥有的零食数量是"+str(quantity))
print(type(quantity))
#flot
meters=1.5
print(f"我的身高是{meters}米")
print(type(meters))
#string
name="cindy"
print(f"我的名字{name}")
print(type(name))
#booleabn
is_online=True
print(f"喜欢吗?{is_online}")
print(type(is_online))
#integar
cat=5
print(f"I have {cat} cats")
print(type(cat))
#float
weight=4.9
print(f"The weight of my cat is {weight}")
print(type(weight))
#string
name= 'Luffy'
print(f"My cat's name is {name}")
print(type(name))
#boolean
is_black= True
print(f"Is my cat's color black? {is_black}")
print(type(is_black))
謝謝老師的教學,我有幾個問題想要請教
1.第一個print之後加的"開頭f"作用是什麼呀? 是改成字串嗎? 那為什麼是放 f 而不是str呢?
2.括號() 和{} 的區別是什麼呢? 因為我print type用{}他就顯示錯誤
3.是只有string的變數需要添加" "嗎? 因為我忘記放他也顯示錯誤
再麻煩老師解答了 :)
你把其他影片看完就懂了
# integer整數
day = 6
print(f'我上週去日本{day}天')
print(type(day))
# float浮點數
hour = 6.5
print(f'我一天睡{hour}小時')
print(type(hour))
# string字串
city = '東京'
print(f'我上週去{city}')
print(type(city))
# boolean布林
very_good = True
print(f'我的岩質如何{very_good}')
print(type(very_good))
cc = 550
print("我的重型機車的排氣量是" + str(cc) )
# float 浮點數
hour = 7.5
# integer 整數
twd = 28
print(f"#昨晚我睡了 {hour} 小時")
print(type(hour))
print(f"我買鮮奶花了 = {twd}元 ")
print(type(twd))
name = 'jason'
print(f"我的名字是 {name} ")
print(type(name))
# boolean # ture, false
Are_you_driving = True
print(f"在開車嗎?{Are_you_driving}")
print(type(Are_you_driving))
#integer 整數
money = 500
print(f"我今天晚餐花了 {money} 元")
print(type(money))
# float 浮點數
magnification = 1.35
print(f" 原住民考試加分可以乘以{magnification} 倍")
print(type(magnification))
# string 字串
GPU = 'RTX 4090'
print(f"這台電腦最貴的就是這張 {GPU} ")
print(type(GPU))
# boolean 布林值 # true, False
is_nice =True
print(f"今天天氣好嗎{is_nice}")
print(type(is_nice))
#integer 整數
piece = 6
print(f"我今天練了{piece}首曲子")
print(type(piece))
# float 浮點數
Completeness = 55.5
print(f"每首平均完成 {Completeness} 扒")
print(type(Completeness))
# string 字串
style = '練習曲'
print(f"曲風是{style}")
print(type(style))
#boolean 布林值
is_online = True
print(f"今天有練認真練習嗎? {is_online}")
print(type (is_online))
# integer
stayNights = 2
print(f'How long will you stay? For {stayNights} nights.')
# float
Tips = 5.6
print(f'How much tip did you gave to the waiter? {Tips} bucks.')
# string
waiterName = 'Jason'
print(f"What is the waiter's name? {waiterName}~ Nice waiter")
# bool
handsomeOrNot = True
print(f"Is he handsome? {handsomeOrNot}! I couldn't agree more.")
#integer整數
age=30
print(f"我明年滿{age}")
#flaot浮點數
gpa=8.5
print(f"我每天上班{gpa}小時")
print(type(gpa))
#string字串
work="甜點師"
print(f"我的工作是{work}")
print(type(work))
#boolean布林值
Delicious=True
print(f"我做的甜點好吃嗎?{Delicious}")
print(type(Delicious))
#integer 整數
班次 = 10
print(f"禮拜六通往陽明山的公車有 {班次} 班")
print(type(班次))
#float 浮點數
時間 = 1.5
print(f"每班次間隔為 {時間} 小時")
print(type(時間))
#string 字串
心情 = '五味雜陳'
print(f"看到那麼多人在排隊的心情是 {心情} ")
print(type(心情))
#boolean true, false
is_problem = True
print(f"不喜歡這樣的狀況嗎? {is_problem} ")
print(type(is_problem))
constitution="fat"
print(f"我的體質是{constitution}")
print(type(constitution))
length=155
print(f"我的身高是{length}")
print(type(length))
score=45.23
print(f"我的成績是{score}")
print(type(score))
play=True
print(f"我想要出去玩{play}")
print(type(play))
# integer 整數
dog = 1
print(f"嚕嚕是{dog}隻臘腸狗")
print(type(dog))
# float 浮點數
weight = 7.8
print(f"嚕嚕的體重 {weight} 公斤")
print(type(weight))
# string 字串
name = '嚕嚕'
print(f"臘腸的名字是 {name} ")
print(type(name))
# boolean # true, false
fat = True
print(f"嚕嚕很胖{fat}")
print(type(fat))
謝謝程式柴
# integer
age = 23
print(f"我的年紀是 {age} 歲")
print(type(age))
# float
mean = 90.5
print(f"考試平均成績 {mean} 分")
print(type(mean))
# string
school = '國立xx大學'
print(f"我今年考上 {school} xx所")
print(type(school))
# boolean # true,false
applied = True
print(f"上榜 {applied}")
print(type(applied))
#integer 整數
month=11
print(f"我的生日在{month}月")
print(type(month))
#float 浮點數
kg=65.8
print(f"我的體重約{kg}公斤")
print(type(kg))
#string 字串
國家='日本'
print(f"我最想去的國家是{國家}")
print(type(國家))
#boolean 布林值 #if else #true false
I_handsome=True
print(f"我是全世界最帥的男人嗎 {I_handsome}")
print(type(I_handsome))
x=181
y=99.5
z='LM'
print("我的身高是+str(x)")
print(f"我的英语分数是{y}")
print(f"我的名字是{z}")
ON_r=True
print(type(ON_r))
A=5
print(f"A是 {A} ")
distance=90.6
print(f"我的距離是{distance}")
My name=Tiffany
print(f"我的名字是 {My name}")
at home=False
print(f"在家? {at home}")
Bread = 3
print(f"我早上吃了{Bread}個麵包")
print(type(Bread))
# float 浮點數
Point = 4.3
print(f"這家餐廳評論有{Point}分")
print(type(Point))
# string 字串
City = '台北'
print(f"這次旅行我們去{City}")
print(type(City))
# boolean 布林值
eat_breakfast = True
print(f"你在吃早倉嗎?{eat_breakfast}")
print(type(eat_breakfast))
大師~
😆厲害 把難的語言教成 簡單
過獎了!
gpa=3.3
print(f"#我的 GPA {gpa}分")
按測試出現
請問有哪裡按錯嗎 ?? 出現以下訊息@@!
"D:\PyCharm 2023.3.4\python project\pythonProject\.venv\Scripts\python.exe" "D:\PyCharm 2023.3.4\python project\pythonProject\.venv\variables and type.py"
File "D:\PyCharm 2023.3.4\python project\pythonProject\.venv\variables and type.py", line 11
float 浮點數
^^^^^^^^^
SyntaxError: invalid syntax
Process finished with exit code 1
Day=7
print(f"我的上課畢業日子完成了{Day}天")
print(type(Day))
# float 浮點數
hour=3.5
print(f"外國留學生每星期的睡覺時間是{hour}小時")
print(type(hour))
# string 字串
grade=3.5
print(f"加入協會的成績必須達到{grade}等級")
print(type(grade))
# boolean 布林值 # true, False
is_online=True
print(f"這次完成功課的感受快樂嗎?{is_online}")
print(type(is_online))
謝謝老師❣
people = 16
print(f'今天的與會人數為{people}人')
print(type(people))
reviews = 4.2
print(f"這間餐廳在google的評價為 {reviews} 星")
print(type(reviews))
country = 'Japan'
print(f"我下禮拜要去{country}玩")
print(type(country))
attendance = True
print(f'有出席嗎? {attendance}')
print(type(attendance))
感謝!
感謝老師的教學影片,有錯誤得部分也請老師指出
# integer 整數
number = 17
print(type(number))
# float 浮點數
score = 97.5
print(f"我的考卷得了 {score} 分 ")
print(type(score))
# string
name = 'Paul'
print(f"我的名字是 {name} ")
print(type(name))
# boolean # true, false
of_course = True
print(f"人生毫無意義嗎? {of_course}")
print(type(of_course))
你跑起來沒問題應該就沒問題
@@CodeShiba OKOK謝謝老師
#integer
year=2024
print(f"This year is {year}")
print(type(year))
#float
score=99.5
print(f"my exam score is{score}")
print(type(score))
#string
school='大學'
print(f"我正在讀{school}")
print(type(school))
#boolean , true , false
is_online=True
print(f"正在打遊戲嗎?{is_online}")
print(type(is_online))
gpa = 3.9
print(f"my GPA is {gpa} ")
print(type(gpa))
name = 'Daniel'
print(f"my GPA is {name} ")
print(type(name))
youcansaythatagain = True
print(f"He is handsome . {youcansaythatagain}")
print(type(youcansaythatagain))
age = 15
print(f"my age is {age}")
print(type(age))
謝謝老師
讚
# integer 整數
length = 17
print(f'我的夥伴 {length} 公分')
print(type(length))
# float 浮點數
perimeter = 10.6
print(f'它的周長 {perimeter} 公分')
print(type(perimeter))
# string
nameP = '小小方'
print(f'它的名字是 {nameP} ')
print(type(nameP))
# boolean true, false
is_hard = True
print(f'硬嗎 {is_hard} ')
print(type(is_hard))
print('謝謝老師指導^^')
# integer
numbers = 4
print(f"我的狗有{numbers}条腿")
print(type(numbers))
# float
weight = 1.223
print(f"它平均每天消耗{weight}KG食物")
print(type(weight))
# string
location = '床底'
print(f"你能在{location}找到它")
print(type(location))
# boolean
can_speak = True
print(f"它是否会说话{can_speak}")
print(type(can_speak))
#interger
car=10
print(f"我買了{car}台車")
print(type(car))
#float浮點數
time=5.2
print(f"我每天花{time}小時開車")
print(type(time))
#string字串
car_name='瑪莎拉蒂'
print(f"我最愛開的車是{car_name}")
print(type(car_name))
#boolean
review= True
print(f"這台車子好開嗎?{review}")
print(type(review))
開好車喔!
# integer 整數
people = 18
print("球隊人數" + str(people))
print(type(people))
# float 浮點數
goal_of_match = 1.3
print(f"球隊的場均得{goal_of_match}分")
print(type(goal_of_match))
# string 字串
name = 'anho'
print(f"球隊名稱是{name}")
print(type(name))
# boolean # true, false
good = True
print(f"球隊厲害嗎?{good}")
print(type(good))
球隊人數18
球隊的場均得1.3分
球隊名稱是anho
球隊厲害嗎?True
bag = 25
print(f"我的書包價格{bag}")
print(type(bag))
pencil = 25.00
print(f"我的鉛筆價格{pencil}")
print(type(pencil))
earser = "veryexpensive"
print(f"我的橡皮擦價格{earser}")
print(type(earser))
state_class = False
print(f"我這堂課的是否出席 {state_class}")
print(type(state_class))
#f_string 透過{}可以放入不同資料型別的變數
height = 179
half_h = 179/2
name = 'stephen'
a_man = True
print('我的名字是', name, '(', type(name),')')
print('身高', height, '公分 (', type(height),')')
print('身高的一半是', half_h, '公分 (', type(half_h),')')
print('是男生嗎?', a_man, '(', type(a_man),')')
# integer 整數
kill = 1000
print(f"討伐數{kill}")
print(type(kill))
# float 浮點數(不是整數)
damage = 110612.35
print(f"平均總傷害{damage}")
print(type(damage))
# string 字串
name = '蒼藍星'
print(f"真正的{name}")
print(type(name))
# boolean 布林值
guide_us = True
print(f"指引我們?{guide_us}")
print(type(guide_us))
print(f"在討伐了{kill}隻黑龍後,平均總傷害達到{damage},你不正是那位能指引明路的{name}嗎?{guide_us}")
小小研究生(理科但非資訊相關)來學點python,希望以後會對data處理和繪圖有幫助。可能會順便學一下matlab,搭配使用~!
可以學 現在是趨勢
想問一下3:55哪裡的#是不是可省略
註解可以省略喔
@@CodeShiba 謝謝
Int=1
Float=5.3
Str=“哈密瓜”
Is_male=true
# 如果可以多講解一下f" " 跟 { } 用法就更好了QQ
Homework day1
#int
working_hour = 8
print (f"今天工作了 {working_hour} 小時")
print (type(working_hour))
#str
workplace = "家"
print (f"今天在 {workplace} 工作")
print (type(workplace))
#float
tolet_time = 1.5
print (f"今天在馬桶上待了{tolet_time} 個小時")
print (type(tolet_time))
#boolean
薪水小偷 = True
print (f"今天是薪水小偷嗎? {薪水小偷}")
print (type(薪水小偷))
謝謝老師😀
有喔 f-string 有教學呦
Grade=5
Gym avg score= 59.5
Class name=‘大熊班’
Suspended=true
#integer 整數
day = 30
print(f"我兒子出生{day}天了")
#float 浮點數
salary薪資 = 45
print(f"我的一個月賺 {salary薪資} k")
print(type(salary薪資))
#string 字串
work工作 = 'Engineer 網路工程師'
print(F"我的工作是一位 {work工作}")
print(type(work工作))
# boolean #true微真 ,false微假
love = True
print(f"你愛我嗎?{love}")
print(type(love))
感謝老師
恭喜兒子出生
age= 17# integer
print("我的年龄是”+str(age))
#float
weight=51.5kg
print(f"#我的体重是{weight}’”)
#string
name=alex
print(f"#他的名字是{name}")
#boolean# true, false
is_like cat= true
print(f"# 你喜欢猫?{is_like cat}“)”
birthday = 1213
print("My BD is " +str(birthday))
print(type(birthday))
high = 160.3
print(f"我的身高是{high}")
print(type(high))
school = "China Medical University"
print(f"I am study in {school} now")
print(type(school))
graduate = True
print(f"Are tou graduate now ? {graduate}")
print(type(graduate))
報考人數 = 3000
print(f"#這次二技有{報考人數}人")
print(type(報考人數))
平均分數 = 65.5
print(f"#我的成績{平均分數}分")
print(type(平均分數))
我的名字 = ('安緹')
print(f"#我的名字是{我的名字}")
print(type(我的名字))
我考試有成功嗎 = True
print(f"#我考試有成功嗎{我考試有成功嗎}")
print(type(我考試有成功嗎))
#這次二技有3000人
#我的成績65.5分
#我的名字是安緹
#我考試有成功嗎True
謝謝教學!!!
#integer數字
age=12
Print(f”我現在已經{age}歲了!)
Print(type(age)”)
#float 小數
GPA=4.5
Print(f”這家酒店的分數是{GAP})
Print(type(GAP)”)
#string字串
His name=bryan
Print(f”他之前的名字叫做(his name)但現在不是”)
Print(type(his name))
#boolean布林值
Open=true
Print(f”門市打開的?{true}”)
Print(type(open))
想知道你使用的字體是哪一種,JetBrains Mono的中文字不太好看
apple system ui font
印象中沒特別改?還是我忘記了
day = 1
print(f”我看這個頻道的第{day}天”)
print(type(day))
time = 7.58
print(f”這部影片約為{time}分鐘”)
print(type(time))
name = 程式柴
print(f”這個頻道叫{name}”)
print(type(name))
sleep = true
print(f”昨晚有睡覺嗎?{sleep})
print(type(sleep))
# integer 整數
year = 1
print(f"我大學畢業 {year} 年了")
print(type(year))
# float 浮點數
cm = 172.2
print(f"我的身高是 {cm} 公分")
print(type(cm))
#string
name = 'Charlie'
print(f"我的英文名字是 {name}")
print(type(name))
# boolean # true, false
is_fine = True
print(f"你還好嗎?{is_fine}")
print(type(is_fine))
交功課了:
language_mastered = 4 # integer
print(f"I have mastered {language_mastered} languages.")
weight = 73.6 # float
print(f"My current body weight is {weight} kg.")
place = 'Tokyo' # string
print(f"Place I have been to is {place}.")
correct = True # boolean
print(f"Is it June now? {correct}")
print(type(correct))
#interger 整數
doll=8
print(f"我的家裡有{doll}個娃娃”)
print(type(doll))
#float 浮點數
bricks =2.2
print(f"這塊磚塊碎成{bricks}塊了”)
print(type(bricks))
#string 字串
penguin =企鵝
print(f"這個娃娃是{penguin}”)
print (type(penguin))
#Boolean 布林值 #true false
happy=true
print (f"你過的快樂嗎?{happy})
print(type (happy))
有創意
想請問一下為什麼老師的符號是全形英文字母卻是半形,然後不知道為什麼程式顯示無法執行,但是它沒有顯示錯誤,就算shift+F10也不行,謝謝老師!
聽不懂耶
2024.03.29
#整數
age=23
print(f"我的年紀是"+str(age))
print(type(age))
#float
weight=48.1
print(f"我的體重{weight}")
print(type(weight))
#string
status="好餓"
print(f"我現在{status}")
print(type(status))
#boolean
pancake_is_tasty=True
print(f"鬆餅好吃嗎?{pancake_is_tasty}")
print(type(pancake_is_tasty))
# integer 整數
goats=28
print(f"我的牧場有{goats}隻羊")
print(type(goats))
# float 浮點數
quantity=14.7
print(f"28隻羊每周吃掉{quantity}M.T(公噸)的草")
print(type(quantity))
# string
title= '美味しい清井-大きな雄の子羊'
print(f"牧場生產的羊肉名稱叫:{title}")
print(type(title))
# boolean 布林值 # true, False
price= True
print(f"羊肉一斤市價約?{price}")
print(type(price))
万能的ChatGPT.....直接教会我python
x = 18
high = 176.4
grade = '高三生'
following = True
print(f"我今年"+ str(x))
print(type(x))
print(f"我的身高是{high}")
print(type(high))
print(f"我現在是{grade}")
print(type(grade))
print(f"上述說的是正確的嗎{following}")
print(type(following))
My name is Adolph
I'm 27 years old
I'm 178.8 cm tall
I'm graduated (True)
age = 31
print("I am " + str (age) + " years old")
print(type(age))
weight = 60.5
print(f"my weight is {weight} kg")
print(type(weight))
name = 'Yin'
print(f"my name is { name }")
print(type(name))
is_home = True
print(f"are you in home?{is_home}")
print(type(is_home))
age = 20
print(f"我的年龄 {age}")
gpa = 3.1
print(f"苹果价格{gpa}")
name ="joker"
print(f"我的名字是{name}")
you_die =ture
print(f"{you_die}")
英文不好 想不出来该写什么英文变量 但是我理解了😂
手写的😂
我的名字是yugod
我的身高是160
我的體重是50.1
在線上嗎?True
我想問問題
老師為什麼float浮點數在print(f"#我的GPA{gpa}分") 前面要加,但在純文字字串也要加呢?print(f"我的名字是{name}")
F是f-string不是float 請看f-string章節
print括號的那個f是什麼意思?
f-string
# integer 整數
age = 2024
print(f'今年是 {age}年 ')
# float 有點數
weigh = 42.5
print(f"#我的體重 {weigh} kg)
print(type(weigh))
# String 字串
name = '涵涵'
print(f'我的名字是 {name}')
print(type(name))
# Boolean 布林值#True, False
here = True
print(f'我可以在重一點嗎? {here}')
print(type(here))
👋💥
再啦!!
# integar
p = 1
print(f'小皮是{p}')
print(type(p))
# float
x = 0.1
print(f'小皮是{x}')
print(type(x))
# boolean
pishappy = True
print(f"小皮快樂嗎?{pishappy}")
print(type(pishappy))
# string
name = '小芳'
print(f'小皮的名字是{name}')
print(type(name))
year = 2024
print(year)
print(type(year))
number = 3.14159
print(f"number")
print(type(number))
a = 'apple'
print(f"How many {a} ")
print(type(a))
open = True
print(f"Does supermarket open? => {open}")
print(type(open))
讚讚
print(f'#我公司的名字是 {company} ')
print(type(company))
print(f'#我工作了 {work} 天')
print(type(work))
print(f'#我的 total_sales Rm{total_sales}')
print(type(total_sales))
print(f'市场还好吗?{good}')
print(type(good))
score = 86.1
subject = 1
go_to_class = True
pet = 'lucky'
print(f"this is subject {subject}")
print(type(subject))
print(f"and I got score {score} in subject {subject}")
print(type(score))
print(f"Do you go to the class? {go_to_class}")
print(type(go_to_class))
print(f"And by the way my pet's name is {pet}")
print(type(pet))
为啥跳过了f string的教学?后面突然加上了f string有点不明白
有教喔,要找一下在哪邊
maney=100
print(f"我有{maney}塊")
print(type(maney))
weight=55.5
print(f"我的體重是{weight}公斤")
print(type(weight))
dream='極光'
print(f"我的夢想是去看{dream}")
print(type(dream))
downwoaded= False
print(f"下載完成了嗎?{downwoaded}")
print(type(downwoaded))
Maney拼錯了嗎
Download也拼錯了啦 沒想到我會看吧
@@CodeShiba 我估計 未來你還會看到很多我打的錯字wwww
這習慣可以的話要修正一下, 人家會覺得你是可靠的人
@@CodeShiba 我正在努力,但很難
語法比c++簡單多了,但是對我來說學太多語言語法會很容易搞混
那你專心學python啦
C++練個四年有小成吧
X = 12
print("迷宮飯現在出到" + str(X) + "集")
print(type(X))
chicken = 0.5
print(f"先西吃了 {chicken} 隻雞")
print("先西吃了" + str(chicken) + "隻雞")
print(type(chicken))
Y = "才女"
print(f"馬路是 {Y}")
print("馬路是" + str(Y))
print(type(Y))
team_member = True
sister = False
print(f"萊歐斯是變態? 隊員: {team_member}")
print(f"萊歐斯是變態? 法林: {sister}")
print(type(sister))
哈哈 有創意