当前位置:网站首页>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)

边栏推荐
- Pre research of image scanning tool
- Script引入CDN链接提示net::ERR_FILE_NOT_FOUND问题
- GPUImage链式纹理的简单实现
- jupyternotebook有汉字数据库吗。在深度学习中可以识别手写中文吗
- There was an error installing mysql. Follow the link below to CMD
- Seekg, tellg related file operations
- JVM 运行时参数
- [Title brushing] Super washing machine
- Pytorch to onnx, onnxruntime reasoning in mmclas
- 事件的传递和响应以及使用实例
猜你喜欢

创新实训(十一)开发过程中的一些bug汇总

微信web开发者工具使用教程,web开发问题

Record some settings for visual studio 2019

"New continent" of mobile application going to sea

Semantic segmentation with pytorch

import torch_geometric 的Data 查看

看完这一篇就够了,web中文开发

Pytorch framework

Codeforces 1637 D. yet another minimization problem - Mathematics, DP

torch_geometric mini batch 的那些事
随机推荐
Codeforces 1629 D. pecuriar movie preferences - simple thinking, palindrome strings
Computational hierarchy -- the problem of large numbers multiplying decimals
A brief introduction to Verilog mode
Implementing pytorch style deep learning framework similartorch with numpy
Experience and learning path of introductory deep learning and machine learning
Codeforces 1637 F. Towers - thinking, DFS
Teach you how to create SSM project structure in idea
2064: [example 2.1] exchange value
Pytorch to onnx, onnxruntime reasoning in mmclas
Overview of embedded system 2- composition and application of embedded system
Informatics Olympiad all in one 1000: introductory test questions
Application of bit operation in C language
数据类型转换和条件控制语句
Codeforces 1637 A. sorting parts - simple thinking
Seeking magic square of order n with C language
Cdeforces 1638 C. inversion graph - simple thinking
2067: [example 2.5] circle
import torch_geometric 的Data 查看
Install RPM package offline using yum
Codeforces 1637 D. yet another minimization problem - Mathematics, DP