This file contains 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
program in the file Observe.py that prints 10 random integers (each random integer should have a value between 0 and 100, inclusive). | |
program uses a constant named NUM_RANDOM, which determines the number of random numbers to print (with a value of 10). | |
It also uses constants named MIN_RANDOM and MAX_RANDOM to determine the minimal and maximal values of the random numbers generated (with respective values 0 and 100). | |
To generate random numbers, you should use the function random.randint() from Python’s random library. | |
Here's a sample run of the program: |
This file contains 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
program in the file observe.py that prints out the calls for a spaceship that is about to launch. Countdown from 10 to 1 and then output Liftoff! | |
Your uses a for loop. | |
Here's a sample run of the program: | |
$ python3 Observe.py | |
10 | |
9 | |
8 |
This file contains 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
""" | |
Remove all one-line comments, | |
a comment which starts and ends on one line | |
Example | |
Input: | |
# This is a comment | |
print('remove_comments') | |
Output: |
This file contains 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 category_dict(filename): | |
# Write your logic here | |
dictionary = {} | |
fp = open(filename,'r') | |
names = fp.readlines() | |
for name in names: | |
words = name.split(' ') | |
words[1] = words[1].strip('\n') | |
if words[1] in dictionary: |
This file contains 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
''' | |
Given the participants' score sheet for your University Sports Day, you are required to find the | |
runner-up score. You are given n scores. Store them in a list and find the score of the runner-up. | |
Input Format | |
The first line contains n. The second line contains an array A[] of n integers each separated | |
by a space. | |
Output Format |
This file contains 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
// Add an empty gameobject to the scene and simple add this script to the gameobject by clicking add component and locate this script | |
// Or create a new script and paste the below code into it. | |
using System.Collections; | |
using Google.XR.Cardboard; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.XR; | |
using UnityEngine.XR.Management; |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
typedef struct stud{ | |
int roll; | |
char name[25]; | |
int age; | |
struct stud *next; | |
}node; |
This file contains 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
using System.Collections; | |
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.Networking; | |
public class findIPaddress : MonoBehaviour | |
{ | |
// Start is called before the first frame update | |
void Start() | |
{ |
This file contains 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
private float currCountdownValue = 0; | |
public IEnumerator StartCountdown(float countdownValue = 10) { | |
currCountdownValue = countdownValue; | |
while (currCountdownValue > 0) { | |
Debug.Log("Countdown: " + currCountdownValue); | |
yield return new WaitForSeconds(1.0f); | |
currCountdownValue--; | |
} | |
} |
This file contains 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
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEngine.XR.ARFoundation; | |
public class PointCloudParser : MonoBehaviour | |
{ | |
public ARPointCloudManager pointCloudManager; | |
private void OnEnable() | |
{ | |
pointCloudManager.pointCloudsChanged += PointCloudManager_pointCloudsChanged; | |
} |