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
| original_str = "The quick brown rhino jumped over the extremely lazy fox." | |
| counter = 0 #intializing a counter varialble | |
| for i in original_str: | |
| counter += 1 #adding 1 after every iteration | |
| num_chars = counter #getting the result |
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
| addition_str = "2+5+10+20" | |
| lst = addition_str.split('+') #converting string into list | |
| new_lst = [int(i) for i in lst] #converting strings into integer | |
| sum_val = sum(new_lst) #Sum of list | |
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
| week_temps_f = "75.1,77.7,83.2,82.5,81.0,79.5,85.7" | |
| temp_list = week_temps_f.split(',') #converting string into a list | |
| lst=[float(i) for i in temp_list] #converting string values of list into float | |
| avg_temp = sum(lst)/len(lst) #calculating average |
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
| #include <iostream> | |
| using namespace std; | |
| struct Node | |
| { | |
| int data; | |
| Node *next; | |
| }; | |
| class link | |
| { | |
| public: |
NewerOlder