In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Enter 123456 8910 using the while loop
2. Find all sums from 1 to 100.
3. Output all odd numbers from 1-100
4. Output all even numbers from 1-100
5. Find 1-2+3-4+5... The sum of all the numbers of 99
6. User login (three tries)
Programming ideas:
3. Write a code that outputs 1-100 first, add conditions in the middle, and skip until 100 when odd numbers are encountered.
1. job
2. operator
3. basic data types
integer: int
String: str
List: list
Tagged: tuple
Dictionary: Dict
IV.For
enumrat
xrange range
Learn Python these days.
1. Programming language
2、python、c#、java
3、python:pypy,cpython,jpython
4. Execution mode
interpreter
file
5. Develop an interpreter
python xxx.py
./ xxx.py #!/ usr/bin/env.python
6、ascii unicode utf-8
7、
2.7 # -*- coding:utf-8 -*-
3.x Default utf-8
8, variable, refers to
Variable Name = Value
Variable Name Requirements:
a. Numeric letters underlined
B. Numbers cannot begin.
c. Cannot duplicate py keyword
q=a
9. Conditions
If condition, elif condition, else
10、while
while condition
Run it once from top to bottom.
(Judge whether the condition is true) from the top down to execute once
...
...
...
Other content:
1, for loop
The user loops through the contents of an iterable object in order
2、enumerate
Add ordinal numbers to iterable objects
3, range and xrange
Specify range, generate specified number
Basic data types:
integer, int
# n1 = 123
# n2 = 456
# print(n1+n2)
# print(n1.__ add__(n2))
Gets the shortest representable binary number
n = 4
zq = n.bit_length()
print(zq)
String, str
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.