🗂 مرکز آموزش پایتون
➖➖➖➖➖➖➖➖
@pythonchallenge
چالش پایتون 在 Telegram 上分享的最新内容
Import pygame,sys
From pygame.locals import *
pygame.init()
print("spam", "eggs")
>>>spam eggs
print("spam" +"eggs")
>>>spameggs
str + int ->Error
str * str->Error
str + str ->strstr
str * int - >strstrstr..... int multiple
str * float ->Error
str + float ->Error
>>>print("spam" *3)
spamspamspam
>>>4*'2'
'2222'
>>>'17'*'87'
TypeError:can't multiply sequence by non-int of type 'str'
>>>'pythonisfun' *7.0
TypeError:can't multiply sequence by non-int of type 'float'
»> text1 = "Ethics are built right into the ideals and objectives of the United Nations."
»> len(text1)
76
»> text2 = text1.split(' ')
»> len(text2)
13
»> text2
['Ethics', 'are', 'built', 'right', 'into', 'the', 'ideals', 'and', 'objectives', 'of', 'the', 'United', 'Nations.']
»> import pygame