代码拉取完成,页面将自动刷新
# This is a sample Python script.
import encodings
# Press Shift+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
def print_hi(name):
# Use a breakpoint in the code line below to debug your script.
print(f'Hi, {name}') # Press Ctrl+F8 to toggle the breakpoint.
class MyTestStr:
name = ""
age = 0
address = ""
# 定义构造方法
def __init__(self, name, age, address):
self.name = name
self.age = age
self.address = address
def __str__(self):
return "name: %s, age: %d, address: %s" % (self.name, self.age, self.address)
def speak(self):
print("%s 说: 我 %d 岁。" % (self.name, self.age))
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
# p = MyTestStr('ztc', 18, '天天超市')
# print("我是一个类:" + str(p))
# p.speak()
a = "我"
str_bytes = bytes(a, encoding='utf-8')
binary_representation = [bin(byte) for byte in str_bytes]
print(binary_representation)
demo_dict = {'name': 'ztc', 'age': 18, "Ledaddress": "天天超市"}
print("address" in demo_dict)
# See PyCharm help at https://www.jetbrains.com/help/pycharm/
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。