zl程序教程

Python题库

  • Python 基础题库

    Python 基础题库

    1.输入任意三个整数,将它们从小到大排列并输出num=[]for i in range(1,4): a = int(input("请输入第{}个整数:".format(i))) num.append(a)num.sort()print(num)2.求任意字符串的长度def len_str(str): num=0 # string=input("

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(49)

    Python 刷Leetcode题库,顺带学英语单词(49)

    Power of Two Given an integer, write a function to determine if it is a power of two.     [#231] Examples: Input: 1 Output: true Input: 0 Output: false Input: 4 Output: true

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(48)

    Python 刷Leetcode题库,顺带学英语单词(48)

    Contains Duplicate Given an array of integers, find if the array contains any duplicates.    [#217] Your function should return true if any value appears at least twice in the ar

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(6)

    Python 刷Leetcode题库,顺带学英语单词(6)

    Remove Duplicates from Sorted Array Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length. Do not allocate e

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(4)

    Python 刷Leetcode题库,顺带学英语单词(4)

    Letter Combinations of a Phone Number Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. A mapping of d

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(43)

    Python 刷Leetcode题库,顺带学英语单词(43)

    House Robber You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(41)

    Python 刷Leetcode题库,顺带学英语单词(41)

    Factorial Trailing Zeroes Given an integer n, return the number of trailing zeroes in n!.    [#172] Examples: Input: 3 Output: 0Explanation: 3! = 6, no trailing zero.In

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(39)

    Python 刷Leetcode题库,顺带学英语单词(39)

    Excel Sheet Column Title Given a positive integer, return its corresponding column title as appear in an Excel sheet.    [#168] For example: 1 -> A 2 -> B 3 -> C ... 26

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(37)

    Python 刷Leetcode题库,顺带学英语单词(37)

    Min Stack Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.   [#155] push(x) -- Push element x onto stack. pop() -- Removes the el

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(34)

    Python 刷Leetcode题库,顺带学英语单词(34)

    Single Number Given a non-empty array of integers, every element appears twice except for one. Find that single one.    [#136] Note: Your algorithm should have a linear runtime c

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(29)

    Python 刷Leetcode题库,顺带学英语单词(29)

    Decode Ways A message containing letters from A-Z is being encoded to numbers using the following mapping: 'A' -> 1 'B' -> 2 ... 'Z' -> 26

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(25)

    Python 刷Leetcode题库,顺带学英语单词(25)

    Search in Rotated Sorted Array Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.   [#33] (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(24)

    Python 刷Leetcode题库,顺带学英语单词(24)

    Subsets Given a set of distinct integers, nums, return all possible subsets (the power set).   [#78] Note: The solution set must not contain duplicate subsets. Example: Input

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(21)

    Python 刷Leetcode题库,顺带学英语单词(21)

    Climbing Stairs You are climbing a stair case. It takes n steps to reach to the top. Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the t

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(18)

    Python 刷Leetcode题库,顺带学英语单词(18)

    Permutation Sequence The set [1,2,3,...,*n*] contains a total of n! unique permutations.   [#60] By listing and labeling all of the permutations in order, we get the following seq

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(16)

    Python 刷Leetcode题库,顺带学英语单词(16)

    Merge Intervals Given a collection of intervals, merge all overlapping intervals.    [#56] Example 1: Input: [[1,3],[2,6],[8,10],[15,18]] Output: [[1,6],[8,10],[15,18]] Expla

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(15)

    Python 刷Leetcode题库,顺带学英语单词(15)

    Maximum Subarray Given an integer array nums , find the contiguous subarray (containing at least one number) which has the largest sum and return its sum.   [#53] Example: In

    日期 2023-06-12 10:48:40     
  • Python 刷Leetcode题库,顺带学英语单词(7)

    Python 刷Leetcode题库,顺带学英语单词(7)

    Remove Element Given an array nums and a value val, remove all instances of that value in-place and return the new length. Do not allocate extra space for another array, you must

    日期 2023-06-12 10:48:40     
  • Python程序设计题库——第一章

    Python程序设计题库——第一章

    Python程序设计 第一章 绪论 一.单选题(共40题,44.0分) 关于 Python 程序格式框架,以下选项中描述错误的是( ) A、Python 语言不采用严格的“缩进”来表明程序的格式框架 B、Python 单层缩进代码属于之前最邻近的一行非缩进代码,多层缩进代码根据缩进关系决定所属范围 C、Python 语言的缩进可以采用 Tab 键实现 D、判断、循环、函数等语法形式能够通过缩

    日期 2023-06-12 10:48:40