This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.course.ai.api.server; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.http.MediaType; | |
| import org.springframework.validation.annotation.Validated; | |
| import org.springframework.web.bind.annotation.PostMapping; | |
| import org.springframework.web.bind.annotation.RequestBody; | |
| import org.springframework.web.bind.annotation.RequestMapping; | |
| import org.springframework.web.bind.annotation.RequestParam; | |
| import org.springframework.web.bind.annotation.RestController; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def something(n): | |
| sequence = [0, 1] | |
| while len(sequence) < n: | |
| sequence.append(sequence[-1] + sequence[-2]) | |
| return sequence[:n] | |
| try: | |
| n = int(input("Enter how many numbers you want: ")) | |
| if n <= 0: | |
| print("Please enter a positive integer.") |
OlderNewer