ブリブリ備忘録 おっ、python

HackerRankの問題とコメント(python3) 拙いですが...

2018-08-01から1ヶ月間の記事一覧

Detect Floating Point Number

・問題 You are given a string . Your task is to verify that is a floating point number. In this task, a valid float number must satisfy all of the following requirements: Number can start with +, - or . symbol. For example: ✔+4.50 ✔-1.0 ✔.…

Tuples 配列とタプルの違いや、標準入力から配列を作成する方法

・問題 Task Given an integer, , and space-separated integers as input, create a tuple, , of those integers. Then compute and print the result of . Note: hash() is one of the functions in the __builtins__ module, so it need not be imported.…

Lists 配列の様々な操作(追加や削除など)

・問題 Consider a list (list = []). You can perform the following commands: insert i e: Insert integer at position . print: Print the list. remove e: Delete the first occurrence of integer . append e: Insert integer at the end of the list.…

Finding the percentage 少数第二位まで出力する方法

・問題 You have a record of students. Each record contains the student's name, and their percent marks in Maths, Physics and Chemistry. The marks can be floating values. The user enters some integer followed by the names and marks for stud…

Write a function 関数の定義

・問題 We add a Leap Day on February 29, almost every four years. The leap day is an extra, or intercalary day and we add it to the shortest month of the year, February. In the Gregorian calendar three criteria must be taken into account t…

Nested Lists 二重配列

・問題 Given the names and grades for each student in a Physics class of students, store them in a nested list and print the name(s) of any student(s) having the second lowest grade. Note: If there are multiple students with the same grade…