Prepare > Python > Introduction
2023. 6. 17. 21:19ㆍHackerRank-Python
Python If-Else
if n%2 != 0:
print('Weird')
else:
if n <= 5 or n > 20:
print('Not Weird')
else:
print('Weird')
Arithmetic Operators
print(a + b)
print(a - b)
print(a * b)
Loops
for i in range(n):
print(i**2)
Write a function
if year % 400 == 0:
leap = True
elif (year % 100 != 0 and year % 4 == 0):
leap = True
return leap
- 문제 이해 똑바로...영문 독해 이슈 ㅋㅋㅋ
Print Function
def replyer(n):
for i in range(1, n+1):
print(i, end='')
replyer(n)
'HackerRank-Python' 카테고리의 다른 글
Prepare > Python > Strings > sWAP cASE (0) | 2023.06.28 |
---|---|
Prepare > Python > Basic Data Types > Lists (0) | 2023.06.27 |
Prepare > Python > Basic Data Types > Finding the percentage (0) | 2023.06.26 |
Prepare > Python >Basic Data Types > Nested Lists (0) | 2023.06.24 |
Prepare > Python > Basic Data Types > List Comprehensions (0) | 2023.06.17 |