-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_ruby_exercises.txt
More file actions
42 lines (40 loc) · 1.64 KB
/
python_ruby_exercises.txt
File metadata and controls
42 lines (40 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
1 - Go to interactive prompt and execute the following
mathematical operators
Hello World
Use '_' to get the last result in irb/python interpreter
get help on methods
2 - String Operations
Reverse a string
find the length
capitalize
uppercase
downcase
is empty or not
print the string three times
3 - Multiline comments
4 - Get user's name as input and greet him
5 - Largest of three numbers
6 - print numbers from 1 to 10 and also in reverse
7 - get a number from user and print multiplication table upto 10 for that number
8 - print odd and even number using step feature
9 - Greatest of two numbers by assiging a construct to a variable
10 - create a new array/list and add heterogenous elements, iterate through them and print each of them
11 - Array/List operations
length of array/list
join two arrays/lists
max element in a number array/list
min element in a number array/list
push 5 to the above number array/list
pop the last element 5 from that array/list
<<<<<<< HEAD
12 - Check if a string is a palindrome or not
13 - Implement a caesar cipher decoder where N = 3
14 -
=======
12 - Write a Ruby/Python program that asks for a year and then tells the user whether the year entered by him/her is a leap year or not.
13 - write a program to find a factorial of a number
14 - Write a program that asks the user for a number n and prints the sum of the numbers 1 to n
15 - Write a program to reverse a list/Array
16 - Write a function that tests whether a string is a palindrome
17 - Write a program that concatenates two lists/arrays
[1,3,5] and [2,4,6] becomes [1,3,5,2,4,6]