当前位置:网站首页>Data type conversion and conditional control statements
Data type conversion and conditional control statements
2022-06-12 13:39:00 【Faith, faith】
1. Data type conversion :
Will float , String to integer
Convert floating point to integer :
String to integer :
The integer , String to floating point
Integer to floating point :
String to floating point :
Binary , octal ,16 Base to 10 Base number
print(int(0b100))
print(int(0o100))
print(int(0x100))
result :4
64
256
take 10 Base to zero , Binary system , octal ,16 Base number
print(bin(4))
print(oct(64))
print(hex(256))
result :0b100
0o100
0x100
Convert string to byte
Convert bytes to strings
take ascii Code to string
print(chr(97))
result :a
Converts a string to ascii code
print(ord('a'))
result :97
2. Conditional control statements
A: 86-100, B: 71-85, C: 61-70, D: 0-60
Enter a grade and print out the grade ( Required if ... elif)
边栏推荐
- jupyternotebook有汉字数据库吗。在深度学习中可以识别手写中文吗
- Seekg, tellg related file operations
- 2061: [example 1.2] trapezoidal area
- Record some settings for visual studio 2019
- 2062: [example 1.3] movie tickets
- Software construction 03 regular expression
- List of common ACM knowledge points (to be continued)
- Web3.0,「激发创造」的时代
- Qt5 plug-in production
- 一种快速创建测试窗口的方法
猜你喜欢
微信web开发者工具使用教程,web开发问题
"New continent" of mobile application going to sea
数据类型转换和条件控制语句
List of common ACM knowledge points (to be continued)
import torch_ Data view of geometric
D1 Nezha Development Board understands the basic startup and loading process
成功定级腾讯T3-2,万字解析
Qualcomm platform development series (Protocol) QMI brief introduction and usage
5V升压到12.6V的锂电池充电IC芯片方案FS4062B
xcode 调试openGLES
随机推荐
Semantic segmentation with pytorch
AVFoundation
Successful job hopping Ali, advanced learning
【刷题篇】抽牌获胜的概率
成功定级腾讯T3-2,万字解析
Codeforces 1637 B. mex and array - reading, violence
安装MySQL时出错,照着下面这个链接,做到cmd就不行了
imagemagick:a gentle introduction to magick++
Pytorch to onnx, onnxruntime reasoning in mmclas
Wechat web developer tools tutorial, web development issues
Innovation training (XI) summary of some bugs in the development process
高通平台开发系列讲解(协议篇)QMI简单介绍及使用方法
苹果电脑上MySQL安装完成找不到怎么办
IC chip scheme fs4062b for lithium battery charging with 5V boost to 12.6V
How to solve the problem of data table query error when SQLite writes the registration function?
It is enough to read this article. Web Chinese development
Getting started with NVIDIA Jetson nano Developer Kit
微信web开发者工具使用教程,web开发问题
Computational hierarchy -- the problem of large numbers multiplying decimals
[Title brushing] Super washing machine